| View previous topic :: View next topic |
| Author |
Message |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Wed Jul 04, 2012 6:47 pm Post subject: !Sapart Trigger Code Request |
|
|
Hello I Need A Small Code For !Sapart
When Op Type !Sapart Nick Msg
The Bot Automatic Part That Nick Using Oper Acess
My Bot Is Network Admin and Sapart command is
/sapart nick #Chan Msg
And Create Like That The Code Only Work In #IspHelp chan
Thanks In Advance
Last edited by Hero on Sun Jul 22, 2012 11:06 am; edited 2 times in total |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Thu Jul 05, 2012 8:56 am Post subject: |
|
|
| Code: |
bind pub * !sapart oper:sapart
proc oper:sapart {nick uhost hand chan text} {
if {![string equal -nocase $chan "#IspHelp"]} return
if {![isop $nick $chan]} return
if {[scan $text {%s%s%s} user channel reason] != 3} {
puthelp "NOTICE $nick :usage: !sapart <nick> <channel> <messsage>"
return
}
putserv "SAPART $user $channel $message"
}
|
Edit: fixed. _________________ Once the game is over, the king and the pawn go back in the same box.
Last edited by caesar on Fri Jul 06, 2012 12:43 am; edited 1 time in total |
|
| Back to top |
|
 |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Thu Jul 05, 2012 3:14 pm Post subject: |
|
|
| <Prince> [19:13:31] Tcl error [oper:sapart]: illegal channel: Hero |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Thu Jul 05, 2012 9:53 pm Post subject: little isop help:) |
|
|
the line throwing that error is:
| Code: | | if {![isop $chan $nick]} return |
try just changing it to:
| Code: | | if {![isop $nick $chan]} return |
GoodLuck:) _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Fri Jul 06, 2012 2:19 am Post subject: |
|
|
Now This Error ....
<Prince> [06:17:21] Tcl error [oper:sapart]: can't read "message": no such variable |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Jul 06, 2012 12:41 pm Post subject: fix for next error |
|
|
The line throwing that error is:
| Code: | | putserv "SAPART $user $channel $message" |
The variable you are calling is message, and it is never being set.
Try just changing that line to:
| Code: | | putserv "SAPART $user $channel $reason" |
GoodLuck:) _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Fri Jul 06, 2012 1:11 pm Post subject: |
|
|
Is It Possible When A User Is Op In ChanneL Then The Bot Not Perform The Sapart Command On Him And Which Op Use The Command For That Op The Bot Notice Him " This Is Also Helper You Cannot Use This Command On Him"
Waiting For Reply |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Jul 06, 2012 1:40 pm Post subject: I don't understand what the command should do:) |
|
|
Up 'til now i've just been fixing the errors in the above command...
I really have no idea what we are wanting to pull off here. I'm not even sure what the SAPART command does, as i've never been a network admin:)
Please better explain our ultimate goal here. _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Fri Jul 06, 2012 2:12 pm Post subject: Let us just try this. |
|
|
Maybe I do understand your last request... lets just try this:
| Code: | proc oper:sapart {nick uhost hand chan text} {
if {![string equal -nocase $chan "#IspHelp"]} return
if {![isop $nick $chan]} return
if {[scan $text {%s%s%s} user channel reason] != 3} {
puthelp "NOTICE $nick :usage: !sapart <nick> <channel> <messsage>"
return
}
if {[isop $user $chan]} {
puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"
return
}
putserv "SAPART $user $channel $message"
} |
Let me know if that does it for you. _________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
| Back to top |
|
 |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Fri Jul 06, 2012 2:48 pm Post subject: |
|
|
Done!!!
Thanks Spike^^ And caesar  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jul 06, 2012 3:27 pm Post subject: |
|
|
You should consider adding a check on botnick as user like:
| Code: |
if {[isbotnick $user]} {
# do whatever you wish
return
}
|
that should be added before the:
| Code: |
if {[isop $user $chan]} {
|
line, else it will match that part first. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Fri Jul 06, 2012 3:51 pm Post subject: |
|
|
| Ok |
|
| Back to top |
|
 |
Hero Halfop
Joined: 26 Jun 2012 Posts: 49 Location: root@localhost
|
Posted: Sat Jul 21, 2012 4:02 pm Post subject: |
|
|
This Code No More Working When I Use Trigger Bot Dosent Reply Me
| Code: | proc oper:sapart {nick uhost hand chan text} {
if {![string equal -nocase $chan "#IspHelp"]} return
if {![isop $nick $chan]} return
if {[scan $text {%s%s%s} user channel reason] != 3} {
puthelp "NOTICE $nick :usage: !sapart <nick> <channel> <messsage>"
return
}
if {[isop $user $chan]} {
puthelp "NOTICE $nick :$user Is Also Helper, You Cannot Use This Command On Them"
return
}
putserv "SAPART $user $channel $reason"
}
|
|
|
| Back to top |
|
 |
|