mIRC Homepage
Posted By: andymps text in a list box, - 12/07/03 01:20 AM
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,
Posted By: Jagfire Re: text in a list box, - 12/07/03 01:45 AM
Loop with $did($dname,listboxid,variable number)
Posted By: Hammer Re: text in a list box, - 12/07/03 01:49 AM
Assuming that ID number 15 is your listbox containing your chosen channels (unselected):
Code:
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.
Posted By: KingTomato Re: text in a list box, - 12/07/03 01:49 AM
you could also do

/privmsg $didtok(dname, id, 44) $+(:,<awaymsg>)
Posted By: andymps Re: text in a list box, - 12/07/03 01:58 AM
Thanx everyone smile
Posted By: Hammer Re: text in a list box, - 12/07/03 01:59 AM
What if he has 50 channels to send it to? wink
Posted By: pheonix Re: text in a list box, - 12/07/03 02:03 AM
(assuming the id of your box is 15)
Code:
alias gmsg {
var %i $1
while (%i &lt;= $did(name,15).lines) &amp;&amp; (%i &lt;= $2) {
did -ck name 15 %i
msg $did(name,15).seltext &lt;yourstuffhere&gt;
inc %i
}
} 


edit:
now he can use $gmsg(10,20) that will message the 10th to 20th channel in listbox.
Posted By: KingTomato Re: text in a list box, - 12/07/03 02:12 AM
or

Code:
alias imaway {
  ; prefs
  var %dname = [color:Red]&lt;dialogname&gt;[/color], %id = [color:blue]&lt;idnumber&gt;[/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
Posted By: Hammer Re: text in a list box, - 12/07/03 02:12 AM
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.
Posted By: Hammer Re: text in a list box, - 12/07/03 02:15 AM
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.
Posted By: pheonix Re: text in a list box, - 12/07/03 02:16 AM
thanx, why would that alias flood him off :tongue: its a simple while loop.
Posted By: KingTomato Re: text in a list box, - 12/07/03 02:17 AM
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.
Posted By: KingTomato Re: text in a list box, - 12/07/03 02:18 AM
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?
Posted By: andymps Re: text in a list box, - 12/07/03 02:22 AM
hmmmm, well there will only be 17 channels, will that flood me ?
Posted By: Hammer Re: text in a list box, - 12/07/03 02:31 AM
Try it and see. laugh That's almost always the best way to learn, anyway.
Posted By: andymps Re: text in a list box, - 12/07/03 02:54 AM
Ok KT i tried ur version and... it didnt work
* /while: invalid format (line 18, away.txt)
Posted By: pheonix Re: text in a list box, - 12/07/03 03:01 AM
add an extra ) to then end wink
© mIRC Discussion Forums