This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Save on .txt

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Save on .txt

Post by ultralord »

How i can save one nick in .txt file ..?

Example: i have 8 places
and when i type !me and if i am first then the bot makes one .txt file with my nick..

and when i type !list i want to see 1. Mynick 2. Other nick

and if i make rehash i dont want to loose the nicks in .txt file..

how i can to do that?
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

i try but i have this error..

Code: Select all

[11:18] Tcl error [g_setmenext2]: can't read "nexttxt": no such variable

the code:
-------------------------------------
set g_nexttxt [list ]

if {![file readable g_nexttxt]} {
  set fileio [open g_nexttxt "w"]
  puts $fileio ""
  close $fileio
}


proc g_nexttxt { } {
global g_nexttxt
  set g_nexttxt [linsert $nexttxt end $nick]
      set fileio [open nexttxt "w"]
      puts $fileio $nexttxt
      flush $fileio
      close $fileio  
}
---------------------------------

set clr "-"

proc g_setmenext2 { nick uhost handle channel arg } {
  global g_active g_shutupchan g_q1 clr g_q2 g_q3 g_q4 g_q5 g_q6 g_q7 g_q8 g_pickupchan g_privategatherchannel g_nexttxt
if { [matchattr $handle H] } {
if { $g_shutupchan == 0 } {
if { $g_active == 0 } {
if { $channel == $g_privategatherchannel } {

if { ( $nick == $g_q1 ) || ( $nick == $g_q2 ) || ( $nick == $g_q3 ) || ( $nick == $g_q4 ) || ( $nick == $g_q5 ) || ( $nick == $g_q6 ) || ( $nick == $g_q7 ) || ( $nick == $g_q8 ) } {

putserv "PRIVMSG $nick :14,1\[7«0 1.: $g_q1 2.: $g_q2 3.: $g_q3 4.: $g_q4 5.: $g_q5 6.: $g_q6 7.: $g_q7 8.: $g_q8 7»14]" 
return 0
}
}
if { $g_q1 == $clr } {
if { [matchattr $handle H] } {

set g_q1 "$nick"
g_nexttxt
putserv "NOTICE $nick :14,1\[7«0 You Have 5 minutes to do a game. Hurry up!  7»14]"
...
....
....
etc..

does anyone know? :/ the file g_nexttxt is created but is empty and when g_q1 convert the nick.. then i want to save it in one .txt the nick..
and when i press !list i want to read the .txt the nick and i see the Result like 1. MYNICK


thnx..
Last edited by ultralord on Fri Oct 12, 2007 4:10 am, edited 1 time in total.
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

anyone?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

1. Indent your code and use code tags
2. Your code doesn't set $nexttxt anywhere. I can only assume you meant to use g_nexttxt in this part:

set g_nexttxt [linsert $nexttxt end $nick]

presumably should be set g_nexttxt [linsert $g_nexttxt end $nick]
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

What if the count goes upto 500 nicks then what will happen? how will be the flood ever realized?
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

ok rosc2112 i am sorry about code tags..

iamdeath no is for private channel and not for 500 users :p

anyway do you underestand anyone what i say? because i dont speak english very well..

i need this.. when someone type !me then bot add's me in place 1st etc..

and my nick will be save in .txt file.. then when i press in #channel !list will be display the queue list like 1. mynick 2.other
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

ultralord wrote:ok rosc2112 i am sorry about code tags..
That was an effort to get you to edit your post and actually fix it.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply