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 

cant add to next line! why?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Patty
Voice


Joined: 27 Apr 2006
Posts: 3

PostPosted: Mon May 01, 2006 4:12 pm    Post subject: cant add to next line! why? Reply with quote

Code:
bind pub - !set chan:level
proc chan:level {nick uhost hand chan text} {
   set AuthNick [lindex $text 0]
   set Authlevel2 0
   set Authlevel 0
   set Authlevel [getchanlogin $nick]
   set Authlevel2 [getchanlogin $AuthNick]
   if {"$Authlevel2" == "0"} {
      putquick "NOTICE $nick :$AuthNick is not authed!"
      return 0
      } else {
   set fs [open $chan.ini r+]
   set finished 0
   while {![eof $fs] && !$finished} {
     gets $fs line
          if {"[lindex $line 0]" == "$Authlevel" && "[lindex $line 1]" == "owner" } {
         putquick "NOTICE $nick :$Authlevel $Authlevel2"
         puts $fs "$Authlevel2 [lindex $text 1]"
         close $fs
         set finished 1
         } else {
            putquick "NOTICE $nick :Your not set as Owner or Master to $chan"
         }
      }
   }
   return 0
}


it will not add to the next line but add it to the current line :S

please help :S
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Tue May 02, 2006 8:36 am    Post subject: Reply with quote

add to which line? your are missing a more detailed explanation of your problem. I really dont understand what you want.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue May 02, 2006 10:43 am    Post subject: Reply with quote

you may do better using
Code:
set fs [open $chan.ini a+]

r+ Open the file for both reading and writing; the file must already exist.
a+ Open the file for reading and writing. If the file doesn't exist, create a new empty file. Set the initial access position to the end of the file.

The r+ option does not tell it to start a new line for input.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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