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 

!needadmin [Filled]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
swi7ch
Voice


Joined: 28 Jan 2008
Posts: 6

PostPosted: Mon Jan 28, 2008 1:51 am    Post subject: !needadmin [Filled] Reply with quote

Hi, Ive looked on Google, and the TCL Archive, and found nothing. I know some codeing, but not a much as I would like to, maybe a lead in the right direction would help.

Decription:

Command= !needadmin

<swi7ch>!needadmin
<bot>Request Has Been Sent To Administration - Please Wait For A Replay

Thats would it would look like in the chan..
in the code. it would do..

/msg <admin name here> $nick is requesting help
/msg <admin name here> $nick is requesting help

Mutliple nicks..


If there is a tcl, and that can be modifed like a !cmd or a !help that would be much appreciated.


Last edited by swi7ch on Mon Jan 28, 2008 11:27 am; edited 1 time in total
Back to top
View user's profile Send private message
w00f
Halfop


Joined: 04 Oct 2006
Posts: 49

PostPosted: Mon Jan 28, 2008 2:51 am    Post subject: Reply with quote

Code:

###

# trigger
set admin(cmd) "!needadmin"

# Admins list
set admin(list) "admin1 admin2 admin3"

###

bind pub - $admin(cmd) pub:needadmin

proc pub:needadmin { nick host hand chan arg } {
  global admin
  set counter 0
  foreach ad [split $admin(list)] {
     if {[onchan $ad $chan]} {
         putquick "PRIVMSG $ad :\037$nick\017 is requesting some help "
         incr counter
     }
  }

  if {$counter == 0} {
     putquick "PRIVMSG $chan :Sorry $nick ,can't find any admin online."
  } else {
     putquick "PRIVMSG $chan :$nick, your request has been sent to administration. Please wait."
  }

}



something like this?
check if that helps you.

~w00f
Back to top
View user's profile Send private message
swi7ch
Voice


Joined: 28 Jan 2008
Posts: 6

PostPosted: Mon Jan 28, 2008 4:40 am    Post subject: Thank You Reply with quote

Looks good, but How do i load it haha??

Tcl error in file '&&&&.conf':
can't set "admin(cmd)": variable isn't array
while executing
"set admin(cmd) "!needadmin""
(file "scripts/needadmin.tcl" line 4)
invoked from within
"source scripts/needadmin.tcl"
(file "&&&&&.conf" line 159)
[02:46] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)


Also, how would it know if a User was online or not? via.
if {$counter == 0} {
putquick "PRIVMSG $chan :Sorry $nick ,can't find any admin online."

Thanks so much, Just ran into that problem.. if u can help? or something maybe..
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jan 28, 2008 8:54 am    Post subject: Reply with quote

"admin" is a reserved variable-name in eggdrop, so the name of that variable within the script needs to be changed into something different.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
swi7ch
Voice


Joined: 28 Jan 2008
Posts: 6

PostPosted: Mon Jan 28, 2008 10:52 am    Post subject: Reply with quote

So.. Like??

Code:
###

# trigger
set waffeles(cmd) "!needadmin"

# Admins list
set waffles(list) "admin1 admin2 admin3"

###

bind pub - $waffles(cmd) pub:needadmin

proc pub:needadmin { nick host hand chan arg } {
  global admin
  set counter 0
  foreach ad [split $waffles(list)] {
     if {[onchan $ad $chan]} {
         putquick "PRIVMSG $ad :\037$nick\017 is requesting some help "
         incr counter
     }
  }

  if {$counter == 0} {
     putquick "PRIVMSG $chan :Sorry $nick ,can't find any admin online."
  } else {
     putquick "PRIVMSG $chan :$nick, your request has been sent to administration. Please wait."
  }

}


even if i change it..

can't read "waffles(cmd)": no such element in array
while executing
"bind pub - $waffles(cmd) pub:needadmin"
(file "scripts/need.tcl" line 11)
invoked from within
"source scripts/need.tcl"
(file "*****.conf" line 159)
[08:59] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Jan 28, 2008 11:15 am    Post subject: Reply with quote

Find
Code:
global admin
and change it to
Code:
global waffles
And also probably should keep it to "waffles"
Code:
# trigger
set waffeles(cmd) "!needadmin"
# Admins list
set waffles(list) "admin1 admin2 admin3"
like
Code:
# trigger
set waffles(cmd) "!needadmin"
# Admins list
set waffles(list) "admin1 admin2 admin3"
since you have
Code:
bind pub - $waffles(cmd) pub:needadmin
Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
swi7ch
Voice


Joined: 28 Jan 2008
Posts: 6

PostPosted: Mon Jan 28, 2008 11:27 am    Post subject: Reply with quote

Wow, it works! Thanks Guys!
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 -> Script Requests 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