| View previous topic :: View next topic |
| Author |
Message |
AlphaTech Voice
Joined: 23 Jul 2014 Posts: 12 Location: New York, USA
|
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Thu Jul 24, 2014 1:45 pm Post subject: Slang Command (gizoogle.tcl) |
|
|
I am not sure if this works, as I have been unable to test it at the moment due to being on a windows PC at this time.
This is a basic script performing the functions you asked for above. If it doesn't work, please find the error (get on dcc partyline and type: .set errorInfo <-) with the capital I on info. This will return the error output and allow us, or someone else, to fix the line(s) at fault.
| Code: |
# Gizoogle TCL - istok@IRCSpeed.org
# $Id: gizoogle.tcl,v1 25/07/2014 04:57:42am GMT +12 (NZST) IRCSpeed Exp $
## Syntax:
## !slang on
## !slang off
## !slang http://website.etc
## !slang www.website.etc
## !slang whatever you wanted to search
## /msg yourbot slang #channel on|off
# Set global trigger here
set pubtrig "!"
# -------- NO EDIT ---------
proc getTrigger {} {
global pubtrig
return $pubtrig
}
setudef flag gizoogle
bind pub - ${pubtrig}slang slang:pub
bind msg - slang slang:msg
proc slang:pub {nick uhost hand chan arg} {
if {[matchattr $hand o|m $chan]} {
if {[lindex [split $arg] 0] == ""} {puthelp "PRIVMSG $chan :ERROR: Incorrect Parameters. SYNTAX: [getTrigger]slang on|off|www.site.etc|search pattern"; return}
if {[lindex [split $arg] 0] == "on"} {
if {[channel get $chan gizoogle]} {puthelp "PRIVMSG $chan :ERROR: This setting is already enabled."; return}
channel set $chan +gizoogle
puthelp "PRIVMSG $chan :Enabled Slang Command for $chan"
return 0
}
if {[lindex [split $arg] 0] == "off"} {
if {![channel get $chan gizoogle]} {puthelp "PRIVMSG $chan :ERROR: This setting is already disabled."; return}
channel set $chan -gizoogle
puthelp "PRIVMSG $chan :Disabled Slang Command for $chan"
return 0
}
if {([lindex [split $arg] 0] != "") && ([lindex [split $arg] 1] == "*http://*") || ([lindex [split $arg] 1] == "*www.*")} {
if {![channel get $chan gizoogle]} {return}
set weblink [lindex [split $arg] 1]
puthelp "PRIVMSG $chan :http://www.gizoogle.net/tranzizzle.php?search=$weblink&se=Go+Git+Dis+Shiznit"
return 0
}
if {([lindex [split $arg] 0] != "") && ([lindex [split $arg] 1] != "") && ([lindex [split $arg] 2] != "")} {
if {![channel get $chan gizoogle]} {return}
set weblink [join [lrange [split $arg] 0 end]]
set extra [regsub -all -- {\s} "$weblink" +]
puthelp "PRIVMSG $chan :http://www.gizoogle.net/tranzizzle.php?search=$extra&se=Go+Git+Dis+Shiznit"
return 0
}
}
}
proc slang:msg {nick uhost hand arg} {
global botnick
set chan [strlwr [lindex [split $arg] 0]]
if {[matchattr $hand o|m $chan]} {
if {([lindex [split $arg] 0] == "") && ([string match "*#*" $arg])} {putserv "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick gizoogle #channel on|off"; return}
if {([lindex [split $arg] 1] == "") && ([string match "*#*" $arg])} {putserv "NOTICE $nick :\037ERROR\037: Incorrect Parameters. \037SYNTAX\037: /msg $botnick gizoogle $chan on|off"; return}
if {[lindex [split $arg] 1] == "on"} {
if {[channel get $chan gizoogle]} {putserv "NOTICE $nick :\037ERROR\037: This setting is already enabled."; return}
channel set $chan +gizoogle
putserv "NOTICE $nick :Enabled Slang Command for $chan"
return 0
}
if {[lindex [split $arg] 1] == "off"} {
if {![channel get $chan gizoogle]} {putserv "NOTICE $nick :\037ERROR\037: This setting is already disabled."; return}
channel set $chan -gizoogle
putserv "NOTICE $nick :Disabled Slang Command for $chan"
return 0
}
}
}
putlog ".:LOADED:. gizoogle.tcl,v1 25/07/2014 04:57:42am GMT +12 (NZST) istok@IRCSpeed.org"
|
Hope it works. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Last edited by Get_A_Fix on Sat Sep 13, 2014 11:02 am; edited 9 times in total |
|
| Back to top |
|
 |
AlphaTech Voice
Joined: 23 Jul 2014 Posts: 12 Location: New York, USA
|
Posted: Thu Jul 24, 2014 4:48 pm Post subject: Re: Slang Search |
|
|
Ok so I put it in the scrtipts folder and eggdrop.conf. Then, I rehashed and it didn't crash! So I did .chanset and everything and then did !slang on and tried !slang http://www.google.com and still nothing... Also, you can run eggdrop on windows... Check out WinDrop.
Edit: It does show up on .binds |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Fri Jul 25, 2014 4:09 pm Post subject: Re: Slang Search |
|
|
Yes, I am fully aware of windrop and its capabilities. I would still prefer to test this on a local machine so I can inspect it and fix it much easier. I only run eggdrops, I would never run a windrop.
The above code works fine. It's now tested and perfected. Enjoy _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sat Sep 13, 2014 11:03 am Post subject: |
|
|
Updated: Try this again, AlphaTech, it works fine on my eggdrop1.6.21 _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
|