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 

Need some help with a "buggy" script.

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


Joined: 15 Oct 2006
Posts: 3

PostPosted: Mon Oct 16, 2006 10:52 am    Post subject: Need some help with a "buggy" script. Reply with quote

Well, im trying again. i have made a buggy script.
When a person borrows the server is seems like the bot does "chattr $nick +R|"
i aint any elete scripter. so i was woundering if it is anyone here who is a good scripter that can "read" the script and see if it is possible to
make it better.

Code:

bind pub - ".borrow" ws:borrow
proc ws:borrow {nick uhost handle chan text} {
 if {[info exists ::wsadmin] && [info exists ::wschan] && [string equal -nocase $chan $::wsadmin] && [string equal $text ""]} {
  if {[isop $::botnick $::wschan]} {
   if {[matchattr $handle +R]} {
    puthelp "privmsg $::wschan :Error: You have alredy borrowed the server whitin the 2 hours!"
    return 0
    } else {
    if {$server == "0"} {
     set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
     set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
     set userhost *!*$userm@$ipmask
     adduser $nick $userhost
     chattr $nick +R|
     set ::server 1
     set ::range 100000
     set ::pwrange 1000
     set ::rcon [expr {int(rand()*$::range)}]
     set ::pass [expr {int(rand()*$::pwrange)}]
     exec ./hlds_srv1 -game cstrike +ip 195.*.*.* -port 27010 +map de_dust2 +maxplayers 12 -pingboost 3 -sv_password $::pass -rcon_password $::rcon &
     puthelp "privmsg $::wschan :\002Status\002: Just now $nick borrows BETA_SERVER!"
     puthelp "cnotice $nick $::wschan :Status: Rcon: $::rcon  Password $::pass Port: 27010 IP: 195.*.*.*"
     utimer $::waittime "chattr $nick -R|"
     utimer $::borrowtime "set ::srv1s 0"
     utimer $::borrowtime [list putquick "privmsg $::wschan :Status: BETA_SERVER Is now avalible for borrowing!"]
     utimer $::btime "exec killall -q /bin/sh ./hlds_srv1 ./hlds_27010"
     return 0
    } elseif {$::Server == "1"} {
     putquick "privmsg $chan :Server 'BETA_SERVER' Is alredy taken!"
    }
   }
  } else {
   puthelp "privmsg $chan :ERROR: need op!"
   return 0
  }
 } else {
  puthelp "privmsg $chan :ERROR: Contact an admin!"
  return 0
 }
}
Back to top
View user's profile Send private message
rosc2112
Revered One


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

PostPosted: Mon Oct 16, 2006 6:45 pm    Post subject: Reply with quote

What problem are you trying to solve? Your msg does not make clear what the problem is.
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