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 

whois help

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


Joined: 01 Dec 2013
Posts: 61
Location: Indonesia

PostPosted: Wed Apr 06, 2016 8:01 am    Post subject: whois help Reply with quote

I asked for help editing this script where I just want this script serves to channel operator only and not for normal user

Code:
bind pub - .whois whois:nick
bind pub - !whois whois:nick

proc whois:nick { nickname hostname handle channel arguments } {
global whois
set target [lindex [split $arguments] 0]
if {$target == ""} {
putquick "PRIVMSG $channel :Maaf kakak perintahnya !whois 14nicknya siapa siapa kakak."
return 0
}
if {[string length $target] >= "31"} {
putquick "PRIVMSG $channel :kakak 14$nickname nickname 14$target terlalu panjang kakak."; return
}
putquick "WHOIS $target $target"
set ::whoischannel $channel
set ::whoistarget $target
bind RAW - 401 whois:nosuch
bind RAW - 311 whois:info
bind RAW - 319 whois:channels
bind RAW - 301 whois:away
bind RAW - 312 whois:server
bind RAW - 313 whois:ircop
bind RAW - 330 whois:auth
bind RAW - 317 whois:idle
}

proc whois:putmsg { channel arguments } {
putquick "PRIVMSG $channel :$arguments"
}

proc whois:info { from keyword arguments } {
set channel $::whoischannel
set nickname [lindex [split $arguments] 1]
set ident [lindex [split $arguments] 2]
set host [lindex [split $arguments] 3]
set realname [string range [join [lrange $arguments 5 end]] 1 end]
whois:putmsg $channel "\[4Whois\] Informasi untuk nick kakak 4$nickname 12:"
whois:putmsg $channel "\[4Whois\] Nickname 12: 14$nickname"
whois:putmsg $channel "\[4Whois\] Identd 12: 14$ident"
whois:putmsg $channel "\[4Whois\] Hostname 12: 14$host"
whois:putmsg $channel "\[4Whois\] Realname 12: 14$realname"
unbind RAW - 311 whois:info
}

proc whois:server { from keyword arguments } {
set channel $::whoischannel
set target $::whoistarget
whois:putmsg $channel "\[4Whois\] status 12: 14$server"
unbind RAW - 312 whois:server
}

proc whois:ircop { from keyword arguments } {
set channel $::whoischannel
set target $::whoistarget
whois:putmsg $channel "\[4Whois\] status 12: IRC Operator"
unbind RAW - 313 whois:ircop
}

proc whois:away { from keyword arguments } {
set channel $::whoischannel
set target $::whoistarget
set awaymessage [string range [join [lrange $arguments 2 end]] 1 end]
whois:putmsg $channel "\[4Whois\] Away 12: 14$awaymessage"
unbind RAW - 301 whois:away
}

proc whois:channels { from keyword arguments } {
set channel $::whoischannel
set channels [string range [join [lrange $arguments 2 end]] 1 end]
set target $::whoistarget
whois:putmsg $channel "\[4Whois\] Channels 12: 14$channels"
unbind RAW - 319 whois:channels
}

proc whois:auth { from keyword arguments } {
set channel $::whoischannel
set target $::whoistarget
set authname [lindex [split $arguments] 2]
whois:putmsg $channel "\[4Whois\] status 12: authed 14$authname"
unbind RAW - 330 whois:auth
}

proc whois:nosuch { from keyword arguments } {
set channel $::whoischannel
set target $::whoistarget
whois:putmsg $channel "Kakak 14$nickname nggak online 4$target kakak."
unbind RAW - 401 whois:nosuch
}

proc whois:idle { from keyword arguments } {
set channel $::whoischannel
set target $::whoistarget
set idletime [lindex [split $arguments] 2]
set signon [lindex [split $arguments] 3]
whois:putmsg $channel "\[4Whois\] Idle 12: 14[duration $idletime]. signon time [ctime $signon]"
unbind RAW - 317 whois:idle
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Apr 06, 2016 8:30 am    Post subject: Reply with quote

If you mean channel operator, as in who as @ in front of their nick, then before the "global whois" line add a new one with:
Code:

if {![isop $nick $chan]} return

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
abah
Halfop


Joined: 01 Dec 2013
Posts: 61
Location: Indonesia

PostPosted: Thu Apr 07, 2016 8:45 am    Post subject: Reply with quote

if the script can be used for all of the script?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Thu Apr 07, 2016 12:10 pm    Post subject: Reply with quote

I don't understand what you asked, but yes, if you add that line will work only for channel operators (@ in front of the nick).
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Fri Apr 08, 2016 11:05 pm    Post subject: Reply with quote

You may also notice that for the whois:nick procedure, you've opened 3 { with only 2 close } - I'm surprised this hasn't produced an error for you. This is the same proc that you would add the code posted above by caesar. Because of the arguments you've used, his code would be done as
Code:

if {![isop $nickname $channel]} return

_________________
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
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