Hello!
i have made a script for my friend.
its a script that gives a random riddle whenever the button gets pushed.
But now i want to count how many times the button gets pushed, so i tried to add a counter.
It worked quite well, but then ofcourse i wanted it to save the number for the next time when he logs in.
i tried to get pieces of other message-counting scripts, and paste them in mine, and update things to match my script.
but it just doesn't seem to work at all.
so now im asking if anyone can update my script and make it save the number it has counted for later use?
I have already put in the counting part, i only need a piece in the script that saves and loads the counted number. The number is in the variable called 'count'.
Heres the code:
code:
var RaadselId = Array();
var teller = 0;
function OnEvent_ChatWndReceiveMessage(ChatWnd,Origin,Message,MessageKind)
{
var Message=Message.toLowerCase();
if(MessageKind == 1 && Message.substr(1,4) == "druk")
{
var ranNum = Math.floor(Math.random() * Raadsel.length);
RaadselId[ChatWnd.handle] = ranNum;
ChatWnd.SendMessage(Raadsel[ranNum]);
teller++;
}
if(MessageKind == 1 && Message.substr(0,7) == "ik wens" || Message.substr(0,8) == "antwoord" || Message.substr(1,9) == "antwoord")
{
ChatWnd.SendMessage(Antwoord[RaadselId[ChatWnd.handle]]);
}
}
i know the arrays 'antwoord' and 'raadsel' aren't there, because i deleted them now, they aren't usefull and they add up a lot of useless space.