mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2015
Posts: 1
E
Mostly harmless
OP Offline
Mostly harmless
E
Joined: Dec 2015
Posts: 1
Here is a Script I wanted to share for anyone out there who was looking for and updated Twitch Chat command Script to allow people to lookup stuff in UrbanDictionary. It uses JSON instead of Sockets which seems to perform better. Also has built in on/off function (MOD's only) and is setup with Global and Pre-User cooldowns to keep people from spamming it.

Make sure to go to mIRC>>Options>>Connect>>Options>>Perform...>>Enable
Then select or Add your twitch Network and add these Perform Commands:
RAW CAP REQ :twitch.tv/membership

That allows mIRC to see if a user is a MOD/op

Feel free to share or mod as you please. If you have any questions check me out on http://twitch.tc/EpicStreamMan
Happy to help ;c)

/*
****************************************************************
** Simple Urbandicitonary Definition and Example/Usage Lookup **
****************************************************************
** Requires the JSON for mIRC http://hawkee.com/snippet/10194 **
****************************************************************
** !ud/!urban/!urbandictionary on/off/search_term_to_look_up **
****************************************************************
*/

; ** Internal udlookup Function which uses Urbandictionsary's API to get Definition and Example/Usage of a Search Term
; ** Syntax: $udlookup(Search_Term) - Usage: $udlookup(pwnd) - Returns: Urbandictionary Definition: Tense of pwn. - Example: You just got PWND!
alias udlookup {
JSONOpen -du lookup http://api.urbandictionary.com/v0/define?term= $+ $replace($1-,$chr(32),$chr(43))
if ($json(lookup,list,0,definition) == $null) return No definition found.
return Definition: $replace($remove($json(lookup,list,0,definition) - Example: $json(lookup,list,0,example),],[),$chr(10),$chr(32),</sarc>,Kappa)
JSONClose lookup
}

; ** This lets MOD's turn on/off the !ud/!urban/!urbandictionary command
; ** Syntax: !ud/!urban/!urbandictionary on/off - Usage: !ud on - Returns: Urbandictionary has been Enabled for Channel
; ** Keeps Token List of Channels it's Enabled/Allowed to Respond in %chan variable
; **
on $*:text:/^!(urban|urbandictionary|ud) o(n|ff)$/iS:#:{
if ($nick isop #) {
if ($regml(2) == n) {
if (!$istok(%chan,#,44)) {
set %chan $addtok(%chan,#,44)
MSG $chan Urbandictionary has been Enabled for Channel BloodTrail
}
else MSG $chan Urbandictionary has been Already Enabled for This Channel BrokeBack
}
else {
if ($istok(%chan,#,44)) {
set %chan $remtok(%chan,#,1,44)
MSG $chan Urbandictionary has been Disabled for Channel BloodTrail
}
else MSG $chan Urbandictionary has been Already been Disabled for This Channel BrokeBack
}
}
else MSG $chan Access Denied. This command is reserved for MOD's only. NotLikeThis
}

; ** Main Chat Command !ud/!urban/!urbandictionary
; ** Syntax: !ud/!urban/!urbandictionary search_term_to_look_up - Usage: !ud pwnd - Returns: Urbandictionary Definition: Tense of pwn. - Example: You just got PWND!
; ** Also setup to give a Hard Coded Answer to whatever you define in the Regular Expression on line 56 below with line 57 bypassing the Urbandictionary lookup all together.
; ** Has a Global cooldown set on line 54 of 5 secs (-u3) and a Per User cooldown on line 55 (-u10) of 15 secs
; **
on $*:text:/^[!@.](urban|urbandictionary|ud)( |$)/iS:#:{
if ($istok(%chan,#,44)) {
IF (!$2) { MSG $chan Usage: !UrbanDictionary [Search Term] OMGScoots
return }
IF ((%fud) || ($($+(%,fud.,$nick),2))) { return }
SET -u3 %fud On
SET -u10 %fud. $+ $nick On
if $regex($2-,/^(epicstreamman|epic|esm)/iS) {
MSG $chan Urbandictionary Definition: EpicStreamMan is the Koolest, Everyone should Follow him, and Sub to his http://Youtube.com/EpicStreamMan Channel and give him all your Money cuz why not Kappa - Example: EpicStreamMan is one bad MoFo..what?! I'm just Talkin' 'bout Epic!
}
Else MSG $chan Urbandictionary $udlookup($2-) MrDestructoid
}
Else {
IF ((%fud) || ($($+(%,fud.,$nick),2))) { return }
SET -u15 %fud On
SET -u30 %fud. $+ $nick On
MSG $chan !Urbictionary is NOT currently Enabled in this Channel NotLikeThis
}
}

Joined: Mar 2016
Posts: 50
T
Babel fish
Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
Hello I have used this script for a while and its working as it should but I have 2 problems right now.

I can only send 1 message per 2 seconds since we are on twitch so making it spam text after text will not work so a timer between the texts would be nice, if it is to long wich it usally is.

So it doesn't flood cuz it wont show up.


And also a blacklist because some words can be really offensive other than that its working as it should.


Link Copied to Clipboard