mIRC Home    About    Download    Register    News    Help

Print Thread
#10385 09/02/03 08:14 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Hello all.

I`m looking for a script that checks how many times a certain nick has done an ONTEXT event and if it goes to the max tells the nick.

Example

Nick1 join #channel and does an event, !rules which is one of my ONTEXT events.
Now my bot should pick this up and store it in a variable (i think) because the max amount of times a user can do this event is 1 time , until they either part or quit and then come back, upon which my bot should remove the variable according to Nick1, and reset it for them.

Nick2 joins in and they do a different ONTEXT event which they are allowed to execute 3 times.
The bot should pick this up and store it until they leave.

I did start to script this kind of thing myself but got stuck, as to how to go about writing such a script, have been searching all over the internet all to no avail.

The problem i would have with this type of script is, sometimes i dont know who is gonna come into my channel and trigger the ONTEXT event, because i have an auto welcome message upon anybody joining the channel, displaying the !rules event for them to type. I did consider that anybody typing this could cause a flood and try to kick the bot off, but i thought maybe i could limit how many times the event could be used.

I was looking at hash tables, but unsure about them, maybe i could do it with such an item.

Thanks if anybody can help me or point me in the right direction

ShadowDemon
mIRC V6.03


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
#10386 10/02/03 01:18 AM
Joined: Dec 2002
Posts: 68
P
Babel fish
Offline
Babel fish
P
Joined: Dec 2002
Posts: 68
Kind of busy now so I won't write a whole script but you'd just do something like this.

on 1:text:*blah*:#chan:{
inc %blah. [ $+ [ $nick ] ] 1
}

that will make %blah.nickname. Sorry I don't have time to help you more.

#10387 10/02/03 02:05 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
K, thanks for setting me off with the idea laugh

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience

Link Copied to Clipboard