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 

Help with Command
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
CyberWar
Voice


Joined: 04 Feb 2008
Posts: 36

PostPosted: Thu Mar 13, 2008 2:04 pm    Post subject: Reply with quote

i want a channel command like this: .gline nick reason

metroid: we trust to our team Wink
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Mar 13, 2008 2:07 pm    Post subject: Reply with quote

CyberWar wrote:
i want a channel command like this: .gline nick reason

metroid: we trust to our team Wink


If you trust your team, why not just oper them?
Back to top
View user's profile Send private message
CyberWar
Voice


Joined: 04 Feb 2008
Posts: 36

PostPosted: Thu Mar 13, 2008 2:12 pm    Post subject: Reply with quote

the normal user are our help team. we have 100% trust to all. and we have another things to make it finish.

I am also a chat operator from a big telecommunications company and he have in the abuse team also opers and normal users
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 13, 2008 2:55 pm    Post subject: Reply with quote

the second script is used as "!gline nick time reason"
it can easily be modified to have a default time in case one is not given
as for "which one is good?"; neither is good, however, both work
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 13, 2008 3:00 pm    Post subject: Reply with quote

DragnLord wrote:
the second script is used as "!gline nick time reason"
it can easily be modified to have a default time in case one is not given
as for "which one is good?"; neither is good, however, both work


DragnLord, sorry to say this, but neither of your scripts work. See my previous posts for details on how they're broken.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 13, 2008 3:12 pm    Post subject: Reply with quote

nml375 wrote:
DragnLord wrote:
the second script is used as "!gline nick time reason"
it can easily be modified to have a default time in case one is not given
as for "which one is good?"; neither is good, however, both work


DragnLord, sorry to say this, but neither of your scripts work. See my previous posts for details on how they're broken.
both scripts worked on my ircds when tested, thank you very much
Unrealircd accepts nicknames OR hostname/ip as the target
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 13, 2008 3:13 pm    Post subject: Reply with quote

the second script works even if only nick is provided (on Unrealircd)
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 13, 2008 3:15 pm    Post subject: Reply with quote

the second script works even if only nick is provided (on Unrealircd)
the ircd then uses it's configured default time for the g:line with the requestor's handle as reason if none is given
although joining reason fixes the reason not being whole if there are spaces

(edit: I only tested script with single word reasons, that's why scripts should not be written before coffee....lol)
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Mar 13, 2008 3:23 pm    Post subject: Reply with quote

Code:
set gline_time "1440"
bind pub G !gline pub:gline
proc pub:gline {n u h c t} {
putserv "gline $t $gline_time :Requested by $n ($h)"
}

Fails, tcl error. gline_time is a global variable. Below is correct.

Code:
putserv "gline $t $::gline_time :Requested by $n ($h)"



Code:
bind pub G !gline pub:gline

proc pub:gline {n u h c t} {
set nick "[lindex $t 0]"
set time "[lindex $t 1]"
set reason "[lrange $t 2 end]"
putserv "gline $nick $time :$reason ($h)"
}

Sloppy, very very sloppy.. not a good way to teach beginners or those wishing to pick up habits from other tcl scripters. This is how you should do it..

Code:
set nick "[lindex [split $t] 0]"
set time "[lindex [split $t] 1]"
set reason "[join [lrange [split $t] 2 end]]"


nml375 is only trying to help you, not ridicule you, neither am I. Just showing you that others will pick up your (bad) habit and unexpected consequences often arise with tcl special characters when treating strings as lists and vice versa.

@nml375 --v
Code:
if {[llenght $data] <3} {

llenght??! Wink
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 13, 2008 3:34 pm    Post subject: Reply with quote

As said by speechles, my intention of pointing out errors/flaws is to help people improve their coding. Just as I hope/expect ppl to point out errors I've made.
For some odd reason, it is (almost) always easier to see other peoples errors than one's own..
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 13, 2008 3:44 pm    Post subject: Reply with quote

splitting $t a second time is quite unneeded as it is already separated by spaces, no need to use split here (TCL already defaults to using the spaces as separators)
it's more of a "bad habit" to do unneeded things, at least in my opinion

thank you for pointing out the global variable error, my ircd configuration uses 1440 as default, so I didn't catch that one
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Mar 13, 2008 3:47 pm    Post subject: Reply with quote

DragnLord wrote:
splitting $t a second time is quite unneeded as it is already separated by spaces, no need to use split here (TCL already defaults to using the spaces as separators)
it's more of a "bad habit" to do unneeded things, at least in my opinion

thank you for pointing out the global variable error, my ircd configuration uses 1440 as default, so I didn't catch that one

Your forgetting your using unsanitized user input . I can use {[]} (nicknames allow these, don't they?) in my input and I've just broken your script (splitting would've kept this from happening).... these are the unexpected consequences that I mentioned happening with tcl special characters.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 13, 2008 3:50 pm    Post subject: Reply with quote

Splitting a second time?
I think you are abit confused 'bout splitting...
Split converts a string to a list, $t is a string since it originates from the binding. Hence it should (must) be splitted prior being used with any commands expecting a list as a parameter. Using your code with a "reason" such as "evil user typing {" would illustrate how your script was broken, and how split is necessary.

A bad habit, in my opinion, is not bothering to keep track whether the content of a variable is a string or a list (always considder user input to be a string, never a list).
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Mar 13, 2008 4:04 pm    Post subject: Reply with quote

speechles wrote:
Your forgetting your using unsanitized user input . I can use {[]} (nicknames allow these, don't they?) in my input and I've just broken your script (splitting would've kept this from happening).... these are the unexpected consequences that I mentioed happening with tcl special characters.

true enough, special characters may present issues, although on my tests with nicknames that included braces it still worked
as I said earlier, coding before coffee is baaaad
Back to top
View user's profile Send private message
CyberWar
Voice


Joined: 04 Feb 2008
Posts: 36

PostPosted: Thu Mar 13, 2008 4:09 pm    Post subject: Reply with quote

My problem at the moment is not yet resolved?
this scripts does not work?
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
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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