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.

!needadmin [Filled]

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
swi7ch
Voice
Posts: 6
Joined: Mon Jan 28, 2008 1:22 am

!needadmin [Filled]

Post by swi7ch »

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.
w
w00f
Halfop
Posts: 49
Joined: Wed Oct 04, 2006 6:50 pm

Post by w00f »

Code: Select all

###

# 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
s
swi7ch
Voice
Posts: 6
Joined: Mon Jan 28, 2008 1:22 am

Thank You

Post by swi7ch »

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..
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

"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
s
swi7ch
Voice
Posts: 6
Joined: Mon Jan 28, 2008 1:22 am

Post by swi7ch »

So.. Like??

Code: Select all

###

# 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)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Find

Code: Select all

global admin
and change it to

Code: Select all

global waffles
And also probably should keep it to "waffles"

Code: Select all

# trigger
set waffeles(cmd) "!needadmin"
# Admins list
set waffles(list) "admin1 admin2 admin3"
like

Code: Select all

# trigger
set waffles(cmd) "!needadmin"
# Admins list
set waffles(list) "admin1 admin2 admin3"
since you have

Code: Select all

bind pub - $waffles(cmd) pub:needadmin
:)
s
swi7ch
Voice
Posts: 6
Joined: Mon Jan 28, 2008 1:22 am

Post by swi7ch »

Wow, it works! Thanks Guys!
Post Reply