mIRC Home    About    Download    Register    News    Help

Topic Options
#35856 - 12/07/03 02:20 AM text in a list box,
andymps Offline
Fjord artisan

Registered: 11/04/03
Posts: 300
Loc: England,Uk
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

Top
#35857 - 12/07/03 02:45 AM Re: text in a list box,
Jagfire Offline
Babel fish

Registered: 14/03/03
Posts: 54
Loop with $did($dname,listboxid,variable number)
_________________________
Website

Top
#35858 - 12/07/03 02:49 AM Re: text in a list box,
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
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.
_________________________
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Top
#35859 - 12/07/03 02:49 AM Re: text in a list box,
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
you could also do

/privmsg $didtok(dname, id, 44) $+(:,<awaymsg>)
_________________________
-KingTomato

Top
#35860 - 12/07/03 02:58 AM Re: text in a list box,
andymps Offline
Fjord artisan

Registered: 11/04/03
Posts: 300
Loc: England,Uk
Thanx everyone smile
_________________________
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11

Top
#35861 - 12/07/03 02:59 AM Re: text in a list box,
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
What if he has 50 channels to send it to? wink
_________________________
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Top
#35862 - 12/07/03 03:03 AM Re: text in a list box,
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
(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.


Edited by pheonix (12/07/03 03:22 AM)
_________________________
new username: tidy_trax

Top
#35863 - 12/07/03 03:12 AM Re: text in a list box,
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
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
_________________________
-KingTomato

Top
#35864 - 12/07/03 03:12 AM Re: text in a list box,
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
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

Top
#35865 - 12/07/03 03:15 AM Re: text in a list box,
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
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

Top
#35866 - 12/07/03 03:16 AM Re: text in a list box,
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
thanx, why would that alias flood him off :tongue: its a simple while loop.
_________________________
new username: tidy_trax

Top
#35867 - 12/07/03 03:17 AM Re: text in a list box,
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
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

Top
#35868 - 12/07/03 03:18 AM Re: text in a list box,
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
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

Top
#35869 - 12/07/03 03:22 AM Re: text in a list box,
andymps Offline
Fjord artisan

Registered: 11/04/03
Posts: 300
Loc: England,Uk
hmmmm, well there will only be 17 channels, will that flood me ?
_________________________
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11

Top
#35870 - 12/07/03 03:31 AM Re: text in a list box,
Hammer Offline
Hoopy frood

Registered: 07/12/02
Posts: 1321
Loc: Georgia, USA
Try it and see. laugh That's almost always the best way to learn, anyway.
_________________________
DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Top
#35871 - 12/07/03 03:54 AM Re: text in a list box,
andymps Offline
Fjord artisan

Registered: 11/04/03
Posts: 300
Loc: England,Uk
Ok KT i tried ur version and... it didnt work
* /while: invalid format (line 18, away.txt)
_________________________
Liek OMG Yuo Stoleded my MageHurtzzzz!!!11

Top
#35872 - 12/07/03 04:01 AM Re: text in a list box,
pheonix Offline
Hoopy frood

Registered: 06/05/03
Posts: 2265
add an extra ) to then end wink
_________________________
new username: tidy_trax

Top