Fix for Short Plot:
I altered the code some but on mine it is line 116. (just do a search in the snippet for "description" (no quotes).. on that line
elseif (%imdb == <p itemprop="description">) sockmark $sockname $puttok($sock($sockname).mark,shortplot:,4,32)
you need to add a
infront of the <p
like this:
elseif (%imdb == <p><p itemprop="description">) sockmark $sockname $puttok($sock($sockname).mark,shortplot:,4,32)
that's it.. i have tried with 5+ movies and all the short plots have worked.. im sure ford has a better way, but this is what i could figure out until he gets a change to update.. Finally i get to help on here instead of needing help.. lol
thanks manic.. I understand all of that.. Appreciate you trying to help tho.. My main issue is "I have tried with no success .. How would i make it so i don't have to turn the bot on? So it would be turned on in any room.. Im using one of my pandorabots and added it to the list that you made.. I would basically just want the script to be auto on in every room I join and have my pandorabot be the one selected.. If thats possible.. or even a On/off trigger someone could use in the channel incase im not infront of the computer to turn on myself... Thanks! " Like a !boton or !botoff command for it.. I have fiddled with the one in the above comments but that doesnt seem to work..
Thanks ford.. great snippet.. Question.. I have tried with no success .. How would i make it so i don't have to turn the bot on? So it would be turned on in any room.. Im using one of my pandorabots and added it to the list that you made.. I would basically just want the script to be auto on in every room I join and have my pandorabot be the one selected.. If thats possible.. or even a On/off trigger someone could use in the channel incase im not infront of the computer to turn on myself... Thanks!
Oh one other thing.. When the question is sent to pandorabot.com does it include the bots name? I'm training a bot just wondering if when someone asks "bot how are you?" if "bot how are you?" is sent for a response or "how are you?" is sent? If bot name is sent too, is there a way to remove it when the question is sent.. Reason i ask is because sometimes i get weird responses back from pandorabots and i believe its because the bots name is included in the question.. I have it set so it loses focus of someone after 3 seconds so people have to keep sayng bot name to carry a convo with it. THanks again ford! Great jon on all your snippets
is there a way to make the bot only respond once or twice to someone and stop automatically? i have had a problem with the bot staying focused on people and have to keep saying shutup in the chat. maybe so the bot would respond once or twice if someone says its name then stops until its name is called again? thanks in advance
thanks S reject.. I dont really understand that too much.. a little out of my league.. this is what i came up with
on $:text:/.(?=com\b|net\b|org\b|ca\b|uk\b|tv\b|name\b|ly\b)/iS:#:{
if (%links == 1) {
.kick # $nick 2 | /describe $chan Whoa! $nick $+ , Didn't you read the rules below?? Take this time to read them B)
}
}
on :text:!Links on:#:{
%links = 1
describe $chan Links are now going to get Timeouts.
}
on *:text:!Links off:#:{
%links = 0
describe $chan Links are now Allowed.
}
seems to work for what i need.. Do you have any idea how i would add a Mod checker to my code above?
Btw, Im just learning if you couldn't tell, or i would use your code.. its a little to advanced.. want to try to make my own for the most part.. or atleast use ones that i understand instead of just copy and pasting and having to ask how to do everything... Thanks again guys.. This is a awesome forum..Everyone is so helpful
Oh yeah how do I post my Code in the boxes like you guys are? i dont see a option to do it.
@Jethro I got it.. Thanks tho jethro..
How does this look?
on $*:text:/.(?=com\b|net\b|org\b|ca\b|uk\b|tv\b|name\b|ly\b)/iS:#:{
if (%links == 1) {
.kick # $nick 2 | /describe $chan Whoa! $nick $+ , Didn't you read the rules below?? Take this time to read them B)
}
}
on *:text:!Links on:#:{
%links = 1
describe $chan Links are now going to get Timeouts.
}
on *:text:!Links off:#:{
%links = 0
describe $chan Links are now Allowed.
}
@Jethro This is for Justin tv servers.. I wanted a !on and !off script for it... so mods could control too not just through irc...
@Jethro jethro any idea how i would add a On/Off command for this link protection code you helped me with?
on @$*:text:/.(?=com|net|org|ca|uk|tv|name|ly)/iS:#:{
.kick # $nick 2 | /describe $chan Whoa! $nick $+ , Don't Post links in here without permission from a mod.. Cya in 10 mins B)
}
I found a On/Off script but I tried everything and cant seem to get it working properly.. this regex is confusing
would there be a way to add this to !weather script? this is what i have tried but doesnt seem to work...
on *:TEXT:!weather:#: {
if ($($+(%,weather,#),2) != $false) { code here }
else { msg $nick Private Msg -> $nick -> I'm silent in # }
}
on $@*:TEXT:/^(!weather on|!weather off)$/S:#: {
if ($nick isop #) {
if ($regml(1) == !weather off) {
set $+(%,weather,#) $false
msg # User commands are now off.
/timer1 1 1 msg # Want to turn them back on? Type !ucmd on
}
elseif ($regml(1) == !weather on) && $($+(%,weather,#),2) != $false {
msg # User Commands are already on.
}
else {
unset $+(%,weather,#)
msg # User Commands are now on.
}
}
}
on *:SOCKOPEN:YahooWeather:{
tokenize 32 $sock($sockname).mark
if ($sockerr) { $1 $false | halt }
sockwrite -n $sockname GET /forecastrss?w= $+ $2 $+ $iif($3,&u= $+ $3) HTTP/1.1
sockwrite -n $sockname Host: weather.yahooapis.com
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:YahooWeather:{
tokenize 32 $sock($sockname).mark
if ($sockerr) { $1 $false | halt }
var %read
sockread %read
%read = $regsubex(%read,/ +/g,$chr(32))
if ($regex(%read,/<title>City not found<\/title>/i)) {
$1 $false
sockclose YahooWeather
halt
}
if ($regex(%read,/<yweather:(\S+)(.*)\/>/)) {
var %prefix = $iif($regml(1) == forecast,$iif($hget(Weather,today_day),tomorrow,today),$regml(1))
noop $regex($regml(2),/\b(.*?)="(.*?)"/g))
var %num_match = $regml(0)
while (%num_match) {
wadd $+(%prefix,_,$regml($calc(%num_match - 1))) $regml(%num_match)
dec %num_match 2
}
}
elseif ($regex(%read,/<title>(.*?)<\/title>/i)) {
wadd title $regml(1)
}
elseif (%read == </rss>) {
$1 $true
sockclose $sockname
halt
}
}
on *:SOCKOPEN:WOEID:{
tokenize 32 $sock($sockname).mark
if ($sockerror) { $1 $false | halt }
sockwrite -n $sockname GET /v1/places.q(' $+ $urlencode($2-) $+ ')?appid= $+ $Y_APPID HTTP/1.1
sockwrite -n $sockname Host: where.yahooapis.com
sockwrite -n $sockname Connection: Close
sockwrite -n $sockname $crlf
}
on *:SOCKREAD:WOEID:{
tokenize 32 $sock($sockname).mark
if ($sockerror) { $1 $false | halt }
var %read
sockread %read
If ($regex(%read,/yahoo:total="0"\/>/)) { $1 $false | halt }
Elseif ($regex(%read,/<woeid>(.*)<\/woeid>/)) {
$1 $regml(1)
sockclose $sockname
halt
}
}
on *:text:*:*:{
if ($regex($1-,/^[!.@&]w(?:eather)? (.*)$/i)) {
if (%weather.flood == 2) {
msg # Flood Protection Activated.
inc -u10 %weather.flood 1
}
Elseif (%weather.flood > 2) {
return
}
elseif (%weather.channel) {
msg # Another weather lookup is already in progress, please try again momentarly
inc -u5 %weather.flood 1
}
Else {
getWOEID UpdateWeather $regsubex($regml(1),/\b(c(elcius)?|f(arenheit)?)\b/i,)
set %weather.u $lower($left($regml(1),1))
set %weather.channel #
inc -u5 %weather.flood 1
}
}
}
alias weatherReplace { return $regsubex($1,/&(\S+?)&/g,$hget(Weather,\1)) }
alias -l wADD { hadd -m Weather $1- }
alias -l Y_APPID { return L8j7ok7V34GTI61wyDk20Uy5PazMYrKUEAHruXNndmOzvkOHgQfVlOz6Az8R9Ib_1A-- }
alias urlEncode { return $regsubex($$1,/([\W\D])/g,$+(%,$base($asc(\t),10,16))) }
alias GetWeather {
if ($regex($1-,/^\S+ \S+( [fc])?$/i)) {
if $hget(Weather) { hfree Weather }
if ($sock(YahooWeather)) { sockclose YahooWeather }
sockopen YahooWeather weather.yahooapis.com 80
sockmark YahooWeather $1-
}
}
alias GetWOEID {
if ($sock(GetWOEID)) { sockclose GetWOEID }
if ($2) {
sockopen WOEID where.yahooapis.com 80
sockmark WOEID $1-
}
}
alias UpdateWeather {
if ($1) {
getWeather DisplayWeather $1 %weather.u
}
else {
msg %weather.channel Unable to find location, please try again!
unset %weather.*
}
}
alias DisplayWeather {
if ($1) {
msg %weather.channel $weatherreplace(&title&)
var %x = Today, High: &today_high&&units_temperature& Low: &today_low&&units_temperature& Cur: &condition_text& &condition_temp&&units_temperature&
.timer 1 1 msg %weather.channel $weatherreplace(%x)
var %x = Tomorrow, High: &tomorrow_high&&units_temperature& Low: &tomorrow_low&&units_temperature& &tomorrow_text&
.timer 1 2 msg %weather.channel $weatherreplace(%x)
}
else {
msg %weather.channel Unable to find weather report, please try a different location.
}
unset %weather.*
}
; ############################################
; ## DISPLAY VARIABLES and Examples ##
; ############################################
/*
&astronomy_sunrise& = 6:46 am
&astronomy_sunset& = 6:40 pm
&atmosphere_humidity& = 54
&atmosphere_pressure& = 982.05
&atmosphere_rising& = 0 ;// 0 is steady, 1 is rising, 2 is falling
&atmosphere_visibility& = 16.09
&condition_code& = 28
&condition_date& = Wed, 29 Sep 2010 11:53 am PDT ;// Last time weather was update
&condition_temp& = 27
&condition_text& = Mostly Cloudy
&location_city& = Beverly Hills
&location_country& = United States
&location_region& = CA
&title& = Conditions for Beverly Hills, CA at 11:53 am PDT
&today_code& = 30
&today_date& = 29 Sep 2010
&today_day& = Wed
&today_high& = 30
&today_low& = 18
&today_text& = Partly Cloudy
&tomorrow_code& = 30
&tomorrow_date& = 30 Sep 2010
&tomorrow_day& = Thu
&tomorrow_high& = 28
&tomorrow_low& = 18
&tomorrow_text& = Partly Cloudy
&units_distance& = km
&units_pressure& = mb
&units_speed& = km/h
&units_temperature& = C
&wind_chill& = 27
&wind_direction& = 210 ;// 0-359, 0 is north, 180 is south
&wind_speed& = 9.66
*/
Thanks guys
ok thanks!
on @$*:text:/.(?=com|net|org|ca|uk|tv|name)/iS:#:{
.kick # $nick 2 | /describe $chan Whoa! $nick $+ , Don't Post links in here without permission from a mod.. Cya in 10 mins B)
}
I had to change a few things for it to display the message in the chat. guess because its on jtv.. Any idea on what the command is for timeouts? not bans. i tried ban -k600? that still seems to ban.. problem with the ban instead of timeout is that after 2 bans even though they are unbanned 10 mins later jtv bans the users IP. the kick code above only does a Timeout i just cant figure out how to pick for how long.
hmm and that seems to be banning people.. its on justin dot tv.. the .kick fuction seems to be just giving Timeouts.. I dont want to ban people. also the @ doesnt seem to check if they are a mod. I'm running into this problem alot... some of the snippets on here work great on there others dont work at all or i have to change a few things for them to work.
other problem i have ran into is that some people don't put www. in alot of links.. I tried to put .com but it seems to be causing some problems.. had someone banned because the first word of their second sentence was come. they didnt put a space between the period and come and seen it as .com for some reason.. thanks again for the help, greatly appreciated!
wow thanks alot jethro and sunny... Appreciate the help.. I'm not trying to be lazy just having some trouble finding how to do certain things.. I have learned a good bit of what i know from your comments on other snippets alone lol.. any good advice for getting further on learning this? Ive basically been just rewriting others code on my own and removing/adding things to see what happens lol, probably not the easiest way of doing things