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 help with simple help script, its my 1st tcl :)

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


Joined: 04 Nov 2008
Posts: 1

PostPosted: Tue Nov 04, 2008 9:18 am    Post subject: need help with simple help script, its my 1st tcl :) Reply with quote

hello, i have 1 problem here
i want to make simple help tcl... but i get error:
Tcl error [helpas]: extra characters after close-brace

its my first script Smile so i dont know what i made wrong..

sory for my bad english and there is script

Code:

bind pub - .pagalba helpas


proc helpas { nick host handle chan text } {
   if {[lindex $text] == $null} {
      puthelp "notice $nick :===---Informacija gaunama apie cs.bleen.lt serveri---==="
      puthelp "notice $nick :===---Galimos komandos---==="
      puthelp "notice $nick : "
      puthelp "notice $nick :Komandos prienamos visiems"
      puthelp "notice $nick :.pagalba - .cs - .admin - .zaidejai - .ip - .map - .nextmap"
      puthelp "notice $nick :.timeleft - .web"
      puthelp "notice $nick : "
      puthelp "notice $nick :Komandos kuriomis gali naudotis kanalo voisai (+v) "
      puthelp "notice $nick :Jaigu norite parasyti kanors i cs serva naudokite komanda say"
      puthelp "notice $nick :pavizdys say <tekstas> ir jusu tekstas bus parasyta cs serve"
      puthelp "notice $nick : "
      puthelp "notice $nick :Komandos kuriomis gali naudotis kanalo opai ( @ ) "
      puthelp "notice $nick :amx_banip - amx_unban - amx_map - amx_kick"
      puthelp "notice $nick :amx_slay - amx_slap jai adminai noretu daugiau komandu"
      puthelp "notice $nick :rasykite irc nick bacarrdy arba bacarrdy@twistedfm.lt"
      puthelp "notice $nick : "
      puthelp "notice $nick :Jaigu norite suzinoti kokios nors komandos detalesne informacija"
      puthelp "notice $nick :tada rasykite .pagalba komanda"
      puthelp "notice $nick :pvz.. .pagalba amx_unban arba .pagalba zaidejai ir taip toliau"
      puthelp "notice $nick : "
      puthelp "notice $nick :Pagarbiai #bleen komanda"
   }else{
      if {[lindex $text] != $null} {
         if {[lrange $text 1] == cs} {
            puthelp "notice $nick :Komandos .cs aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :komanda .cs parodo siuo metu besilankanciu musu public servo pavadinima"
            puthelp "notice $nick :ip, porta, zemelapi ir kiek zmoniu losia"
         }
         if {[lrange $text 1] == zaidejai} {
            puthelp "notice $nick :Komandos .zaidejai aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .zaidejai parodys visus zaidziancius cs.bleen.lt serverije"
         }
         if {[lrange $text 1] == ip} {
            puthelp "notice $nick :Komandos .ip aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .ip parasys jums cs.bleen.lt skaitini ip ir porta"
         }
         if {[lrange $text 1] == map} {
            puthelp "notice $nick :Komandos .map aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .map parodys zemelapi kuris dabar yra"
         }
         if {[lrange $text 1] == nextmap} {
            puthelp "notice $nick :Komandos .nextmap aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .nextmap parasys zemelapi kuris bus sekantis serve cs.bleen.lt"
         }
         if {[lrange $text 1] == timeleft} {
            puthelp "notice $nick :Komanods .timleft aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .timeleft parasys uz kiek laiko serverije cs.bleen.lt prasides naujas zemelapis"
         }
         if {[lrange $text 1] == admin} {
            puthelp "notice $nick :Komandos .admin aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .admin parodys cs.bleen.lt serverio administracijos nikus, nikus irc ir cs zaidime"
         }
         if {[lrange $text 1] == web} {
            puthelp "notice $nick :Komandos .web aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda .web parasys oficialu cs.bleen.lt web saita"
         }
         if {[lrange $text 1] == amx_banip} {
            puthelp "notice $nick :Komandos amx_banip aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda amx_banip isbanina zmogu is serverio"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :amx_banip nikas laikas priezastis"
            puthelp "notice $nick : "
            puthelp "notice $nick :Nikui gali buti tiesiog naudojamos belekokios 3 raides is niko"
            puthelp "notice $nick :svarbiausia, kad nebutu tokiu paciu niku so tokiom paciom raidem:"
            puthelp "notice $nick :pav.."
            puthelp "notice $nick :amx_banip nikas 20 banas 20ciai minuciu yra = amx_banip nik 20"
            puthelp "notice $nick : "
            puthelp "notice $nick :Cytus baniname visam laikui, lengviausia tai padaryti yra: "
            puthelp "notice $nick :amx_banip nikas a  tokiu atveju isbanins zaideja visam laikui"
         }
         if {[lrange $text 1] == amx_unban} {
            puthelp "notice $nick :Komandos amx_unban aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda amx_unban nuima bana tam tikram zaidejui"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :amx_unban ip_adresas . pvz... amx_unban 213.190.234.56"
         }
         if {[lrange $text 1] == amx_map} {
            puthelp "notice $nick :Komandos amx_map aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda amx_map pakeicia zemelapi"
            puthelp "notice $nick :naudojimo budas"
            puthelp "notice $nick :amx_map zemelapis . pvz.. amx_map de_dust2"
         }
         if {[lrange $text 1] == amx_kick} {
            puthelp "notice $nick :Komandos amx_kick aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda amx_kick ismeta zaideja is serverio"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :amx_kick nikas priezastis . pvz amx_kick botas afk"
            puthelp "notice $nick :Priezasti nurodyti nebutina"
         }
         if {[lrange $text 1] == amx_slay} {
            puthelp "notice $nick :Komandos amx_slay aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda amx_slay nuzudo tam tikra zaideja"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :amx_slay nikas"
         }
         if {[lrange $text 1] == amx_slap} {
            puthelp "notice $nick :Komandos amx_slap aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda amx_slap nuima zaidejui tam tikra kieki givybiu arba nenuima ir pastumia zaideja"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :amx_slap nikas kiek_dmg_nuimti   .pvz... amx_slap balvonas 5 arba amx_slap balvonas 10"
            puthelp "notice $nick :jai dmg kieki ivestumete 0 tai tik pastumtu jai 100 tai butu taspats kas slay"
         }
         if {[lrange $text 1] == say} {
            puthelp "notice $nick :Komandos say aprasymas"
            puthelp "notice $nick : "
            puthelp "notice $nick :Komanda say nusiuncia zinute is irc kanalo i cs serveri"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :say tekstas  .pvz.. say laba diena zaidejai"
            puthelp "notice $nick : "
            puthelp "notice $nick :Kad parasyti is cs servo i kanala nadokite komanda !irc"
            puthelp "notice $nick :Naudojimo budas"
            puthelp "notice $nick :!irc tekstas   .pvz.. !irc zdarova ir tau aisku sita teksta reikia vest ne i konsole o tiesiog paspaudus y kaip ir belekoki kita teksta"
         }
      }
   }
}


ty for any help Smile
Back to top
View user's profile Send private message
dwickie
Halfop


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Tue Nov 04, 2008 11:02 am    Post subject: Re: need help with simple help script, its my 1st tcl :) Reply with quote

Code:

   }else{


should be

} else {
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Nov 04, 2008 12:44 pm    Post subject: Reply with quote

Apart from the }else{ pointed out by dwickie, your list commands (lindex and lrange) are flawed. Incorrect number of arguments, and you are using a string, not a list. Please convert $text into a list before using commands such as lindex, lrange, etc (see the manual-page for "split" for a few hints on how to do this).
_________________
NML_375, idling at #eggdrop@IrcNET
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