This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

!Sapart Trigger Code Request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

!Sapart Trigger Code Request

Post by Hero »

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.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

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.
Last edited by caesar on Fri Jul 06, 2012 12:43 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Post by Hero »

<Prince> [19:13:31] Tcl error [oper:sapart]: illegal channel: Hero
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

little isop help:)

Post by SpiKe^^ »

the line throwing that error is:

Code: Select all

if {![isop $chan $nick]} return
try just changing it to:

Code: Select all

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
.
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Post by Hero »

Now This Error ....
<Prince> [06:17:21] Tcl error [oper:sapart]: can't read "message": no such variable
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

fix for next error

Post by SpiKe^^ »

The line throwing that error is:

Code: Select all

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: Select all

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
.
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Post by Hero »

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
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

I don't understand what the command should do:)

Post by SpiKe^^ »

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
.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Let us just try this.

Post by SpiKe^^ »

Maybe I do understand your last request... lets just try this:

Code: Select all

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
.
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Post by Hero »

Done!!!
Thanks Spike^^ And caesar :)
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

You should consider adding a check on botnick as user like:

Code: Select all

if {[isbotnick $user]} {
# do whatever you wish
return
}
that should be added before the:

Code: Select all

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.
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Post by Hero »

Ok
H
Hero
Halfop
Posts: 49
Joined: Tue Jun 26, 2012 6:27 pm
Location: root@localhost
Contact:

Post by Hero »

This Code No More Working When I Use Trigger Bot Dosent Reply Me

Code: Select all

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" 
}
Post Reply