| View previous topic :: View next topic |
| Author |
Message |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Wed Mar 12, 2008 11:07 pm Post subject: Help with Command |
|
|
Hi all
me again i know
I've searched this forum for fix it my problem, but i think i'm the first here.
How i can make a command like this for my Bot?.
| Code: | | .gline <nick> <time> <reason> |
This Command is for a spezial team on our irc but i dont know how i can make this, i've tested some things and used google but i can't find a howto or
little script
Thanks for Helping |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu Mar 13, 2008 12:28 am Post subject: |
|
|
might want to try the really obvious:
| Code: | | putserv "gline <nick> <time> :<reason>" |
RFCs really were created for a good reason.... |
|
| Back to top |
|
 |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Thu Mar 13, 2008 3:48 am Post subject: |
|
|
But that is not all? this does not work  |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Thu Mar 13, 2008 5:07 am Post subject: Re: Help with Command |
|
|
| CyberWar wrote: | | How i can make a command like this for my Bot? |
What kind of command? irc/dcc?
(PS: I moved this thread from the Scripting Help forum) _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Thu Mar 13, 2008 7:09 am Post subject: |
|
|
Thanks for removing
the kind of command for the irc is: | Code: | | .gline <user> <time> <reason> |
The Command for IRC |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Mar 13, 2008 10:24 am Post subject: |
|
|
Thinking of something like this?
| Code: | bind dcc n gline dcc:gline
proc dcc:gline {handle idx text} {
set data [split $text]
if {[llength $data] <3} {
putidx $idx "Usage: .gline <nick> <time> <reason>"
} {
puthelp "GLINE [lindex $data 0] [lindex $data 1] :[join [lrange $data 2 end]]"
}
}
|
Creates a dcc partyline command named ".gline" that basically sends a "GLINE" command to the irc server with the provided parameters.
Edit: Based upon documentation for Unreal 3.1.1 GLINE
http://www.technerd.net/irc-commands.html
| Quote: | *** GLINE command ***
This command provides timed G:Lines. If you match
a G:Line you cannot connect to ANY server on the
IRC network. A time of 0 in the GLINE makes it permanent (Never Expires).
In Unreal 3.1.1 you may also specify the time in the format 1d10h15m30s.
IRC Operators only.
Syntax: GLINE <user@host mask> <seconds to be banned> :<reason> (Adds a G:line for user@host)
GLINE -<user@host mask> (Removes a G:line for user@host)
Example: GLINE *@*.dal.net 900 :Spammers (Adds a 15 min G:line) |
Edit: Fixed minor typo, thnx for the hint Speechles _________________ NML_375, idling at #eggdrop@IrcNET
Last edited by nml375 on Fri Mar 14, 2008 7:26 am; edited 2 times in total |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu Mar 13, 2008 10:34 am Post subject: |
|
|
this small script requires you to set authorized users by "chattr <handle> +G"
| 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)"
} |
this works for "!gline <nick>", it sets the gline for 1 day
If you need a script that works in a particular way, you will have to be a lot more specific in your request. |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu Mar 13, 2008 10:54 am Post subject: |
|
|
this script will use the input style you asked for in first post
!gline <nick> <time> <reason>
and tacks onto the end the handle of the user setting the gline
| 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)"
} |
|
|
| Back to top |
|
 |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Thu Mar 13, 2008 11:03 am Post subject: |
|
|
ok we have a abuse team with opers and users without oline. and we need this bot for the users without olines in our team.
when a user type: .gline <user> <glinetime> <reason>
The bot must gline the user with: gline reason and the current time
e.g.
Quit: user has been temporarily banned from this network: BlaReason 16:00:13 Thursday |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Thu Mar 13, 2008 11:17 am Post subject: |
|
|
the ircd will already tell ircops when the g:line is set (unless the ircd is poorly coded)
example:
*** G:Line added for *@x.x.x.x on Sat Feb 9 02:17:23 2008 GMT (from OperServ to expire at Mon Feb 11 02:17:23 2008 GMT: You're using an insecure proxy.)
I just don't see a reason to add the time to the g:line reason. |
|
| Back to top |
|
 |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Thu Mar 13, 2008 1:06 pm Post subject: |
|
|
yep right DragnLord but we must add the time in the reason. Hm ok i think u have right.
Then only .gline nick reason |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Mar 13, 2008 1:15 pm Post subject: |
|
|
| DragnLord wrote: | ...
| 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)"
} |
|
Don't use list-commands on strings...
Also, keep in mind that lrange returns a list, not a string - considder joining the result. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
CyberWar Voice
Joined: 04 Feb 2008 Posts: 36
|
Posted: Thu Mar 13, 2008 1:26 pm Post subject: |
|
|
which script is now good? i have here now many ideas  |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Mar 13, 2008 1:34 pm Post subject: |
|
|
Depends..
Do you want a "channel command", "msg command", or a "dcc partyline command"?
The code in my initial post is proper if you wish for a dcc partyline-based command. For a channel or msg-based command, some minor modifications would have to be made.
DragnLord's first post is flawed as it tries to access a non-existant local variable (intended to access a variable in globalspace), second uses lindex and lrange in an improper manner. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Mar 13, 2008 2:02 pm Post subject: |
|
|
Seriously, if you're going to give "non opered" staff access to a gline command and they make the slightest mistake, you could gline the entire network.
You should instead think really hard how smart that is. (NOTE: your non opered staff could gline anyone, including opers) |
|
| Back to top |
|
 |
|