Skip to content
MSN

loops & duplicate of gettoks

A TG007 community discussion started by DreaM.

Discussion 13 posts
Page 1 of 1
Open
Topic #2352 · 13 published posts · 869 views

Hi guys, Another question..

 

I am using:

on *:dialog:check:sclick:3:{ 
 did -r $dname 13
 var %f 1
 while ($lines( $+ $did(3).seltext $+ .txt) >= %f) {
   did -a $dname 13 $gettok($read( $+ $did(3).seltext $+ .txt,%f),1,32)
   inc %f
 }
 else break
}

 

so I get the data in the list like this:

 

Dream

Super

High

Super

Dream

Power

.

.

 

I want the bot to don't duplicate the name so I want to get:

 

Dream

Super

High

Power

.

.

 

how to do it guys?

Edited Dec 26, 2004 4:31 PM by DreaM

It doesn't look like there's anything wrong there. Maybe the problem's also visible in the txt file?

 

well seems that you did not get what I mean cleric...

 

I already have in the text file:

 

Dream .........................................................

Super ..............................................

Power ..................................................

Dream .................................................... (again)

Super ........................................................... (again)

High ...............................................

 

I want my script to don't type two Dreams, yes there are in the file 2 dreams but I want it to type Dream once and ignore if there is another one.

why not just stop it writting the names twice in the first place

make it check the text file for the nick b4 writting it

My code does NOT have bugs. It just develops random features.

I can not do it OZZY for some reasons

tell me code your using to write the names

My code does NOT have bugs. It just develops random features.

ozzy I meant that I can not change the write code because they are like messages from other members and can not be added to many different files.

 

Conclusion, it is impossible to change the way of writing to the text files and that is why I asked for help

 

I think it is possible to do it such as:

transfaring data to temporary text file and if the nick is in the temporary text file{ Dont type it again ..... } and if is not in the temporay text file { did -a $dname | inc %f }

 

any help about the idea ?

well if they are messages, you would need the names to show up twice if they sent you 2 messages lol, or it wouldnt get them all

My code does NOT have bugs. It just develops random features.

if ($read( $+ $did(3).seltext $+ .txt,%f) !isin $did(13)) did -a $dname 13 $ifmatch

 

can you rewrite all of the code again cleric after adding the line you typed?

did not work cleric, But thank you OZZY & cleric because it is now

on *:dialog:check:sclick:3:{ 
did -r $dname 13
var %f 1, %used, %data
while ($lines( $+ $did(3).seltext $+ .txt) >= %f) {
 %data = $gettok($read( $+ $did(3).seltext $+ .txt,%f),1,32)
 if (!$istok(%used,%data,32)) {
   did -a $dname 13 %data
   %used = %used %data
 }
  inc %f
}
}

Edited Dec 29, 2004 6:35 PM by Pete®tje

thank you peterteje worked and I really appreciate you and your reply.