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.

Help with Command

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Help with Command

Post by CyberWar »

Hi all

me again i know 8)

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: Select all

.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
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

might want to try the really obvious:

Code: Select all

putserv "gline <nick> <time> :<reason>"
RFCs really were created for a good reason....
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

But that is not all? this does not work :?
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Help with Command

Post by user »

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"?
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

Thanks for removing :)

the kind of command for the irc is:

Code: Select all

.gline <user> <time> <reason>
The Command for IRC
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Thinking of something like this?

Code: Select all

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
*** 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
Last edited by nml375 on Fri Mar 14, 2008 7:26 am, edited 2 times in total.
NML_375
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

this small script requires you to set authorized users by "chattr <handle> +G"

Code: Select all

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.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

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: Select all

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)"
}
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

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
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

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.
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

yep right DragnLord but we must add the time in the reason. Hm ok i think u have right.

Then only .gline nick reason
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

DragnLord wrote:...

Code: Select all

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
C
CyberWar
Voice
Posts: 36
Joined: Mon Feb 04, 2008 4:49 am

Post by CyberWar »

which script is now good? i have here now many ideas 8)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

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)
Post Reply