|
Joined: Apr 2003
Posts: 300
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2003
Posts: 300 |
I am now making an away script, and i need to make it to is msg's the channels listed in the list box, anyone help, thanx in advance for anythin u can do,
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
|
|
|
|
Joined: Mar 2003
Posts: 54
Babel fish
|
Babel fish
Joined: Mar 2003
Posts: 54 |
Loop with $did($dname,listboxid,variable number)
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Assuming that ID number 15 is your listbox containing your chosen channels (unselected):
var %i = 1
while $gettok($didtok(15, 44), $+(%i, -, $calc(%i + 3)), 44) {
.timer 1 $calc(%i / 2) describe $ifmatch is away: stuff here
inc %i 4
} If you wish to use /msg instead of /me, switch the word describe to the word msg. The timer should keep you from flooding yourself off by spacing out each group of messages.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
you could also do
/privmsg $didtok(dname, id, 44) $+(:,<awaymsg>)
-KingTomato
|
|
|
|
Joined: Apr 2003
Posts: 300
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2003
Posts: 300 |
Thanx everyone
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
What if he has 50 channels to send it to?
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
(assuming the id of your box is 15)
alias gmsg {
var %i $1
while (%i <= $did(name,15).lines) && (%i <= $2) {
did -ck name 15 %i
msg $did(name,15).seltext <yourstuffhere>
inc %i
}
}
edit: now he can use $gmsg(10,20) that will message the 10th to 20th channel in listbox.
Last edited by pheonix; 12/07/03 02:22 AM.
new username: tidy_trax
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
or
alias imaway {
; prefs
var %dname = [color:Red]<dialogname>[/color], %id = [color:blue]<idnumber>[/color], %tok = 1, %chans
while ($gettok($didtok(%dname, %id, 44), %tok, 44) {
var %chans = $addtok(%chans, $ifmatch, 44)
if ($numtok(%chans, 44) == 15) || (%id == $did(%dname, %id).lines) {
/raw PRIVMSG %chans $+(:,$$1-)
/unset %chans
}
/inc %tok
}
}
that would msg 15 channels at a time. How's that hammer? >:D btw--miss me on dalnet? heh
-KingTomato
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
If he used that alias, he would flood himself off.
Also, perhaps you might be interested to know that UBBCode allows you to use [[/b]code] and [[/b]/code] tags around your code to indent it properly, making your scriptlets much easier for everyone to read and understand.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Not all IRCds will accept more than 4 targets in a single PRIVMSG. Furthermore, a lot of those that do will alert opers for those messages with more than a certain number of targets, perhaps attracting unnecessary and unwanted attention for a simple away message.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
thanx, why would that alias flood him off :tongue: its a simple while loop.
new username: tidy_trax
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
Its basically an /amsg with the channel list in a listbox rather than using $chan(N). I've never heard of an /amsg triggering an opnotice, therefor wouldn't see this being a problem.
-KingTomato
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
As hammer pointed out, what if the user had 100 channels in the listbox. Now thats 100/msg's, that looks liek a flood to me..
EDIT: Anyways, why are u selecting each and every item, then using seltext? You do realise did has a line number parameter, correct?
-KingTomato
|
|
|
|
Joined: Apr 2003
Posts: 300
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2003
Posts: 300 |
hmmmm, well there will only be 17 channels, will that flood me ?
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
Try it and see. That's almost always the best way to learn, anyway.
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
|
|
|
|
Joined: Apr 2003
Posts: 300
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2003
Posts: 300 |
Ok KT i tried ur version and... it didnt work * /while: invalid format (line 18, away.txt)
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
add an extra ) to then end
new username: tidy_trax
|
|
|
|
|