mIRC Home    About    Download    Register    News    Help

Print Thread
queue system #99270 30/09/04 02:59 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
From tabo's scripting tips..
<a href="http://
http://www.mircscripts.org/showdoc.php?type=tutorial&id=916
" target="_blank">
http://www.mircscripts.org/showdoc.php?type=tutorial&id=916
</a>

he said..

Quote:

If your script/addon sends tons of replies (@find, !seen, ctcp help, etc) write a queue system or the user will be easily flooded off.


anyone have an example of code i could look at?

Re: queue system #99271 30/09/04 05:28 AM
Joined: Mar 2003
Posts: 1,271
L
LocutusofBorg Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
there would be plenty of scripts out there with a queue system. Just download one off the same website. As for the basic setup, here's what I would do (could be easier, but I like toi account for the possibility of sending multiple stuff top one nick)

when you wanna send, don't send, but use a command like this:

Code:
$addqueue($ctime,nick,eventtype,message)


where nick is obvious, and eventtype can be something like msg, notice, or ctcp. Use the name of the command for ease. Also, nick can be a nick, but also a channel...

Code:
alias addqueue {
  %queue = %queue $1
  hadd Queue $1 $2 $3 $4-
}


This adds the sequence of events to a queue (variable), and when the time comes, the script will yank the necessary information from the hastable (create it when you start mIRC). You could of course do some errorchecking to make sure the hashtable exists, and make it if it doesn't.

Last step: when you start mIRC, start a timer:

Code:
timerqueue -0 0 3 readqueue


and create the alias that runs through the %queue variable and sends the commands. This is set up so it only sends commands to nicks still on at least one channel you're on. With a small modification, you could even use the same code to queue /whois requests in the same queue, as well as kicks, bans, etc.

Code:
alias readqueue {
  tokenize 32 $hget(Queue,$gettok(queue,1,32))
  if ($!comchan($1,0)) { %queue = $deltok(%queue,1,32) | timer 1 0 readqueue }
  $2 $1 $3-
}





DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Re: queue system #99272 30/09/04 05:32 AM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
You could check out a queue system script on mircscripts.org at http://www.mircscripts.org/comments.php?cid=2309

Not a bad example if you can follow the code

Re: queue system #99273 30/09/04 06:49 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
thanks guys...