mIRC Home    About    Download    Register    News    Help

Topic Options
#35292 - 10/07/03 05:23 AM hm..... little problem involving tokenize
EviL_SmUrF Offline
Vogon poet

Registered: 26/12/02
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?


Top
#35293 - 10/07/03 05:44 AM Re: hm..... little problem involving tokenize
Jerk Offline
Vogon poet

Registered: 09/12/02
Posts: 169
Loc: Wisconsin
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 }

Top
#35294 - 10/07/03 07:15 AM Re: hm..... little problem involving tokenize
EviL_SmUrF Offline
Vogon poet

Registered: 26/12/02
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 =/

Top
#35295 - 10/07/03 09:01 AM Re: hm..... little problem involving tokenize
Jerk Offline
Vogon poet

Registered: 09/12/02
Posts: 169
Loc: Wisconsin
No need to /tokenize. Just use $gettok

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

Top
#35296 - 10/07/03 03:55 PM Re: hm..... little problem involving tokenize
EviL_SmUrF Offline
Vogon poet

Registered: 26/12/02
Posts: 111
ah sweet, thanks! smile

Top