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.

GLine

Support & discussion of released scripts, and announcements of new releases.
Post Reply
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

GLine

Post by Madalin »

For any questions or bugs please post here.

Code: Select all

#### ++++ Author: MadaliN <madalinmen28@yahoo.com>
### +++ Website: www.Ascenture.ro
## +++ TCL Name: GLine
# +++ Version: 1.0
## ++++
# Commands:
#	!gline 45.432.12.1
#
# For the command to work you need to have VOICE or OP in the main channel
#

bind PUBM - * gline:main

set temp(trigger) {! . `}

proc gline:main {nick uhost hand chan arg} {
	global temp

	if {[string index $arg 0] in $temp(trigger)} {
		set temp(cmd) [string range $arg 1 end]
		set temp(cmd) [lindex [split $temp(cmd)] 0]
		set arg [join [lrange [split $arg] 1 end]]
	} elseif {[isbotnick [lindex [split $arg] 0]]} {
		set temp(cmd) [lindex [split $arg] 1]
		set arg [join [lrange [split $arg] 2 end]]
	} else { return 0 }

	if {[info commands command:$temp(cmd)] != ""} { command:$temp(cmd) $nick $uhost $hand $chan $arg }
}

proc command:gline {nick uhost hand chan arg} {
	global top temp

	if {[isvoice $nick $chan] || [isop $nick $chan]} {

		set ip [lindex [split $arg] 0]

		if {![regexp {^(?:(?:[01]?\d?\d|2[0-4]\d|25[0-5])(\.|$)){4}$} $ip]} { putserv "PRIVMSG $chan :\002$nick\002 -  NO/Invalid IP pattern. USAGE: !gline 193.193.193.193"; return }

		set temp(gchan) $chan
		set temp(gnick) $nick

		putquick "GLINE $ip"
		bind raw - 280 gline:valid
		bind raw - 512 gline:invalid
	}
}

proc gline:valid {from cmd arg} {
	global temp

	set glineI [lindex [split $arg] 1]
	set glineT [lindex [split $arg] 4]
	set glineE [lindex [split $arg] 3]
	set glineR [join [lrange [split $arg] 7 end]]

	putserv "PRIVMSG $temp(gchan) :\002$temp(gnick)\002 - GLine for \00304$glineI\003 was created on \00312[clock format $glineE]\003 meaning \00303[duration [expr $glineT - $glineE]]\003 and it will expire on \00312[clock format $glineT]\003 meaning \00303[duration [expr $glineT - [clock seconds]]]\003. Reason: \00306$glineR"

	catch {unbind RAW - 280 gline:valid}
	catch {unbind RAW - 512 gline:invalid}
}

proc gline:invalid {from cmd arg} {
	global temp

	putserv "PRIVMSG $temp(gchan) :\002$temp(gnick)\002 - There is not GLine for that IP"

	catch {unbind RAW - 280 gline:valid}
	catch {unbind RAW - 512 gline:invalid}
}

putlog "++ Succesfully loaded: \00312GLine"
User avatar
d3n
Voice
Posts: 15
Joined: Wed Jul 13, 2016 2:30 pm
Location: Italy
Contact:

Doesn't work

Post by d3n »

I load this script in my eggdrop, and doesn't work for me... i changed this line and for now work

putquick "GLINE $ip" changed putquick "GLINE *@$ip 3d Abused"

but the problem is don't say in the chan the results..
Post Reply