mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 111
E
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
alright heres the code im having problems with:
Code:
  set %ignorelines $lines(data\ignorelist.db)
  if (%ignorelines == 0) { goto 999 }
  set %t 1
  while (%t <= %ignorelines) {
    tokenize 32 $gettok($read(data\ignorelist.db,%t),1,32)
    if ($1 iswm $fulladdress) { halt }
    inc %t
  }
  :999


this code is under an on *:text:*:?: {

and it is interfering with the rest of my code because 3,000+ lines of code under it all use if ($1 == ignore), if ($1 == freeze) and so forth.

is it possible to achieve the same thing that tokenize is doing and make it place what it is placing in $1 into a %variable so that it wont erase the text in $1, therefor allowing my code to function as before?


Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
Once you use /tokenize you can't undo it. You can use token identifiers without having to /tokenize. Either that or store $1- (the text in the event) to a %variable and then retokenize it (/tokenize 32 %variable)

I have a question about your code though. What is in a sample line in your ignorelist.db file? You $read the line. Then use tokenize 32 on $gettok(line,1,32). Isn't that kind of redundant?

I suggest you convert your ignorelist.db to a hash table. You can
/hadd -m ignorelist <mask> <any xtra data>
and then use:
if ($hfind(ignorelist,$fulladdress,1, W)) { halt }

Joined: Dec 2002
Posts: 111
E
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
*@*testisp.com Added by: EviL_SmUrF


thats a sample line from the ignore list.

as soon as i /tokenize i lose the actual command that was sent to the bot, im tryin to figure out if there is another way to get *@*testisp.com into a variable without losing the actual command that is sent to the bot, which is stored in $1 =/

Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
No need to /tokenize. Just use $gettok

if ($gettok($read(data\ignorelist.db,%t),1,32) iswm $fulladdress) { }

Joined: Dec 2002
Posts: 111
E
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
ah sweet, thanks! smile


Link Copied to Clipboard