mIRC Home    About    Download    Register    News    Help

Print Thread
#205996 05/11/08 04:13 PM
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Hi all, been a long time since i posted anything, been away from
scripting, but i have a new problem since restarting, anyways on
with my question.


How can i limit the use of the on text event within mIRC ?

an example is a user comes to my channel and types

!hi

which in my remotes i think would say
Code:
on 1:TEXT!hi:#test:/describe my bot says hi 


Thats fine, but what if said user then types

!hi
!hi
!hi


yes that would flood kick him true, but i want the script to
give a message and wait, for example

a user types !hi

the script then issues the message in the above example, but then
says User1, please be aware that you can respond to this event two more times within 5 mins

the script checks the time User1 issued the command and waits
for a repsonse of !hi from User1 again with 5 mins, if User1
repats !hi again within the 5 mins, the bot should respond with

User1, please be aware that you can respond to this event one more time within 5 mins

If User1 does this again, warn him that next time he will be kicked from the channel or just kick him.

However is User1 behaves himself and doesnt be a fool the time
should reset.

I think the script would use the use of /timers and variables
but im not sure, also how could i make this as per user and
per !event, also would it use scanning teqnique of a user joining
a channel, i cant remember what its called, the aul or something.

for another example

i have 3 users in my channel

User1
User2
User3

User1 issues the !hi event
User2 issues the !readme event


the !hi event can be setup to show text 3 times within 5 mins
BUT the !readme event can only be used once, while User2 is in
the channel. if he quits the channel the !readme evnt is reset
when User2 comes back.

I know my wording is difficult to understand im trying to get round the scripting in my head as to how i can
do this i had started the script some years ago (About 2006), but since i havnt scipted in over a year ive
forgotton most mIRC commands.

I have just found my OLD on text event script (or part of it)
Code:
on *:text:!rules:#: {
  if (%rules_ $+ $nick = $null) {
    set %rules_ $+ $nick 1
    play $nick sys/rules.txt 1500
  }
  if (%rules_ $+ $nick >= #1) {
    msg $nick You can't use the !rules command more than once till u leave/quit.
  }
}




Thanks in advance and please if anybody can help me or show me
where to start.

Im, using mIRC V6.34 at the moment, havent had time to upgrade



Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
on *:TEXT:!rules:#: {
  var %r = $nick 
  .play $nick rules.txt 1500
  hinc -mu300 Rules %r
  if ($hget(Rules,%r) = 1) { 
    msg $nick *** Be warned that you can't use the !rules command more than once till u leave/quit.
  }
  elseif ($hget(Rules,%r) = 2) {
    kick $chan $nick $+ , you've been told to only use !rules until you have parted the channel. | hdel Rules %r
  }
}


The above script will count if a user triggers !rules more than once within 5 minutes, and if he or she exceeds the time allowance, they'll be kicked.

Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Hi Tomao, Thanks ill try get round to adding that script to mine
maybe play with it some and see what else i can add to the events



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

Link Copied to Clipboard