Need some help

Paste Your code(s) here, and state your problem.

Need some help

Postby nestea » Mon Jul 06, 2009 8:16 pm

I'm trying to make the change in the TCL script I'm writing from !op to say lexan op or something simular.
Code: Select all
bind pub -|- !help help
bind pub -|- !info info
bind pub f|f !voice voice
bind pub f|f !devoice dvoice
bind pub f|f !voiceme voiceme

thats how my binds are setup can someone help me figure out how to successfully redo this setup ?
nestea
 

Re: Need some help

Postby daveyw » Mon Jul 06, 2009 8:24 pm

1 example below....

Code: Select all
# trigger like !op $op %op *op
set trigger "!"

# binds
bind pub n "${trigger}op" pub:op

# procs
proc pub:op {nick uhost hand chan text} {
if {![isop $::botnick $chan]} {
putserv "NOTICE $nick :I need to be opped before I can change modes"
}
else
{
pushmode $chan +o $text
putserv "NOTICE $nick :User \002$text\002 opped"
}
}

# putlog
putlog "loaded op.tcl"
Something like that, I know its not perfectly but it should work.
daveyw
 

Re: Need some help

Postby nestea » Mon Jul 06, 2009 9:11 pm

Thanks:)
nestea
 

Re: Need some help

Postby r0t3n » Mon Jul 06, 2009 9:24 pm

You stated 'lexan op', would 'lexan' be a botnick?

If so, u'd need to manage it differently:

Code: Select all
bind pubm - {*} proc:commands

proc proc:commands {nick host hand chan text} {
  global botnick
  if {[string equal -nocase $botnick [lindex [split $text] 0]]} {
    set cmd [lindex [split $text] 1]
    set text [join [lrange $text 2 end]]
    switch -exact -- $cmd {
      "help" {
       help $nick $host $hand $chan $text
      }
      "info" {
       info $nick $host $hand $chan $text
      }
      "voice" {
       voice $nick $host $hand $chan $text
     }
     "devoice" {
      dvoice $nick $host $hand $chan $text
     }
     "voiceme" {
      voiceme $nick $host $hand $chan $text
     }
   }
 }
}


If you botnick is 'foo' and the command is 'bar' and the arguement is 'm00' then you'd use 'foo bar moo'

Hope this helps =)
r0t3n
 

Re: Need some help

Postby nestea » Mon Jul 06, 2009 10:11 pm

Now I got this the way I want it for now but I just cant seem to get the bot to add a user properly even with .+user in telnet so I'm at a loss I've been studying other scripts for this particular case and I cant make heads or tails of how to do my own version of adduser/remuser any thoughts on this?
nestea
 

Re: Need some help

Postby fraguk » Mon Jul 06, 2009 11:52 pm

When you try to add a use in telnet with .+user , what reply do you get from the bot ? any error's ?
fraguk
 

Re: Need some help

Postby nestea » Tue Jul 07, 2009 1:44 am

No, no errors but my friend still cant use the bot ether cause I'll .+user <name> <host> and .chattr the flags I want him to have +fo but when he gives commands to it, the bot wont respond at all.
nestea
 

Re: Need some help

Postby zNigel- » Tue Jul 07, 2009 1:51 am

nestea wrote:No, no errors but my friend still cant use the bot ether cause I'll .+user <name> <host> and .chattr the flags I want him to have +fo but when he gives commands to it, the bot wont respond at all.



Are you sure the script are using those flags then?
zNigel-
 

Re: Need some help

Postby nestea » Tue Jul 07, 2009 5:23 am

well not sure cause I dont really know how to test it since im the one that did the hello on it and I cant add a user effectivly but even then when I do .+user and then chattr the +fo to him it still didn't work =\

Will try more tomarrow :)
nestea
 


Return to TCL Scripting Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron