mIRC Home    About    Download    Register    News    Help

Print Thread
hm..... little problem involving tokenize #35292 10/07/03 04:23 AM
Joined: Dec 2002
Posts: 111
E
EviL_SmUrF Offline OP
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?


Re: hm..... little problem involving tokenize #35293 10/07/03 04:44 AM
Joined: Dec 2002
Posts: 169
J
Jerk Offline
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 }

Re: hm..... little problem involving tokenize #35294 10/07/03 06:15 AM
Joined: Dec 2002
Posts: 111
E
EviL_SmUrF Offline OP
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 =/

Re: hm..... little problem involving tokenize #35295 10/07/03 08:01 AM
Joined: Dec 2002
Posts: 169
J
Jerk Offline
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) { }

Re: hm..... little problem involving tokenize #35296 10/07/03 02:55 PM
Joined: Dec 2002
Posts: 111
E
EviL_SmUrF Offline OP
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
ah sweet, thanks! smile