mIRC Home    About    Download    Register    News    Help

Print Thread
#251566 23/02/15 04:38 PM
Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
kk.. so no clue where to start on something like this.. but basically what I'm looking for is where someone in the chat could post the command !pizza (with a 24 hour cooldown, which I know how to do that part).. and the bot would tally up how many times that user has done that command and add +1 each time they use it.

So.. in essence, it would look like what i posted in the pic included below.

Anyone mind on guiding me with this one?



Joined: Jan 2004
Posts: 1,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
Just store the value in an ini file.

Code:
on *:text:!pizza:#:{
  var %file = commands.ini, %cmd = $1
  var %sum = $calc($readini(%file,n,$nick,%cmd) + 1)

  writeini %file $nick %cmd %sum
  msg # $nick has now eaten %sum pizza $iif(%sum > 1,slices.,slice.)
}

Joined: Jan 2014
Posts: 107
M
Majeye Offline OP
Vogon poet
OP Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
ahh.. thank you very much.

I'm slowly learning how variables work, this has been a huge help.


Link Copied to Clipboard