| View previous topic :: View next topic |
| Author |
Message |
swi7ch Voice
Joined: 28 Jan 2008 Posts: 6
|
Posted: Mon Jan 28, 2008 1:51 am Post subject: !needadmin [Filled] |
|
|
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 |
|
 |
w00f Halfop
Joined: 04 Oct 2006 Posts: 49
|
Posted: Mon Jan 28, 2008 2:51 am Post subject: |
|
|
| 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 |
|
 |
swi7ch Voice
Joined: 28 Jan 2008 Posts: 6
|
Posted: Mon Jan 28, 2008 4:40 am Post subject: Thank You |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Jan 28, 2008 8:54 am Post subject: |
|
|
"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 |
|
 |
swi7ch Voice
Joined: 28 Jan 2008 Posts: 6
|
Posted: Mon Jan 28, 2008 10:52 am Post subject: |
|
|
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 |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Jan 28, 2008 11:15 am Post subject: |
|
|
Find and change it to 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 |  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
swi7ch Voice
Joined: 28 Jan 2008 Posts: 6
|
Posted: Mon Jan 28, 2008 11:27 am Post subject: |
|
|
| Wow, it works! Thanks Guys! |
|
| Back to top |
|
 |
|