egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Save on .txt

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Tue Oct 09, 2007 11:57 am    Post subject: Save on .txt Reply with quote

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?
Back to top
View user's profile Send private message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Tue Oct 09, 2007 12:31 pm    Post subject: Reply with quote

i try but i have this error..

Code:
[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
Back to top
View user's profile Send private message
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Wed Oct 10, 2007 9:19 am    Post subject: Reply with quote

anyone?
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Wed Oct 10, 2007 1:12 pm    Post subject: Reply with quote

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]
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Wed Oct 10, 2007 2:03 pm    Post subject: Reply with quote

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*...
Back to top
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Wed Oct 10, 2007 2:27 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Oct 11, 2007 7:32 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber