Version 5.4 Posted with a small list of fixes to glitches.
For those who are asking. The old NON-API version is now posted here. <http://www.hawkee.com/snippet/10052/ > Posted for reference purposes only. No support will be available for that script.
@chachin
Similar to what I did for @bladerunner
Replace Lines 47 thru 53 (This changes ! to @)
on $*:INPUT:#: {
if ($regex($1,/^[?](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si)) wunderground $1-
}
on $*:text:/^[?](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si:#: {
wunderground $1-
}
Insert between Line 130 and 131 (This changes the @ back to the ! so the rest of the script will work (helps not having to replace every single ! in the whole code)
;---Command Prep. Checks command to see which data file it will be pulling from depending on command entered ---
set %wu_command $replace(%wu_command,$chr(63),$chr(33))
@Bladerunner I suppose. I know exactly what you are asking. Problem with wunderground. They don't have an 'error' line. So I am going to have to make something up. Something that looks at the variable and if $null, will reply to the user that the location is wrong.
I will look at that when I get the chance.
@Bladerunner I am not sure what you might be doing wrong. PM me your version of the code and I will review over it.
As I had mentioned before, You should only need to do the following:
Replace Lines 47 thru 53 (This changes ! to @)
on $*:INPUT:#: {
if ($regex($1,/^[@](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si)) wunderground $1-
}
on $*:text:/^[@](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si:#: {
wunderground $1-
}
Insert between Line 130 and 131 (This changes the @ back to the ! so the rest of the script will work (helps not having to replace every single ! in the whole code)
;---Command Prep. Checks command to see which data file it will be pulling from depending on command entered ---
set %wu_command $replace(%wu_command,$chr(64),$chr(33))
@chachin , @Phil_FW version add's in code that will also ignore a user that signs off and signs back on a server with a new nick. My code at the top works just fine. But you are more than welcomed to use @Phil_FW's code if you have that issue.
@chachin You can use my botabuse script < http://www.hawkee.com/snippet/7858/>
Just remove the semi-colon on line 56 and load the bot abuse script. This will limit the amount of requests before the bot will then ignore the user/ spam bot.
@chachin
Modify the sockclose area like a so:
Line 302: Remove the or !forecast5 from the if statement. This will keep it from spitting out the long info.
Before
if (%wu_command == !forecast) || (%wu_command == !forecast5) {
After
if (%wu_command == !forecast) {
Lines 324 thru 330. Change the bot from messaging the %wu_nick, to message the channel %wu_chan
if (%wu_command == !forecast5) {
;.timer 1 0 .msg %wu_chan %wu_P1_weekday $+ : %wu_P1_conditions $+ . High: $+(%wu_P1_highf,$chr(176),F,$chr(40),%wu_P1_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P1_lowf,$chr(176),F,$chr(40),%wu_P1_lowc,$chr(176),C,$chr(41))
.timer 1 1 .msg %wu_chan Your forcast for %wu_address
.timer 1 2 .msg %wu_chan %wu_P1_weekday $+ : %wu_P1_conditions $+ . High: $+(%wu_P1_highf,$chr(176),F,$chr(40),%wu_P1_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P1_lowf,$chr(176),F,$chr(40),%wu_P1_lowc,$chr(176),C,$chr(41))
.timer 1 3 .msg %wu_chan %wu_P2_weekday $+ : %wu_P2_conditions $+ . High: $+(%wu_P2_highf,$chr(176),F,$chr(40),%wu_P2_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P2_lowf,$chr(176),F,$chr(40),%wu_P2_lowc,$chr(176),C,$chr(41))
.timer 1 4 .msg %wu_chan %wu_P3_weekday $+ : %wu_P3_conditions $+ . High: $+(%wu_P3_highf,$chr(176),F,$chr(40),%wu_P3_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P3_lowf,$chr(176),F,$chr(40),%wu_P3_lowc,$chr(176),C,$chr(41))
.timer 1 5 .msg %wu_chan %wu_P4_weekday $+ : %wu_P4_conditions $+ . High: $+(%wu_P4_highf,$chr(176),F,$chr(40),%wu_P4_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P4_lowf,$chr(176),F,$chr(40),%wu_P4_lowc,$chr(176),C,$chr(41))
.timer 1 6 .msg %wu_chan %wu_P5_weekday $+ : %wu_P5_conditions $+ . High: $+(%wu_P5_highf,$chr(176),F,$chr(40),%wu_P5_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P5_lowf,$chr(176),F,$chr(40),%wu_P5_lowc,$chr(176),C,$chr(41))
.timer 1 7 .msg %wu_chan %wu_P6_weekday $+ : %wu_P6_conditions $+ . High: $+(%wu_P6_highf,$chr(176),F,$chr(40),%wu_P6_highc,$chr(176),C,$chr(41)) - Low: $+(%wu_P6_lowf,$chr(176),F,$chr(40),%wu_P6_lowc,$chr(176),C,$chr(41))
}
@Hari_Seldon
Along with what @Jethro said about the INPUT and TEXT lines,
I can simply it even more. For the Command Prep Area, just add this simple line:
;---Command Prep. Checks command to see which data file it will be pulling from depending on command entered ---
set %wu_command $replace(%wu_command,$chr(64),$chr(33))
This simply replaces the @ ($chr(64)) with the ! ($chr(33)) in %wu_command.
@Hari_Seldon In the future, You just need to change the two at the beginning (on:INPUT and on:Text),
on $*:INPUT:#: {
if ($regex($1,/^[@](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si)) wunderground $1-
}
on $*:text:/^[@](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si:#: {
wunderground $1-
}
and then modify just the ";---Command Prep." area.
You can simply add the following, and the rest of the code will work just fine.:
;---Command Prep. Checks command to see which data file it will be pulling from depending on command entered ---
if (%wu_command == @w) || (%wu_command == @weather) set %wu_command !weather
if (%wu_command == @forecast) set %wu_command !forecast
if (%wu_command == @forecast5) set %wu_command !forecast5
if (%wu_command == @alert) set %wu_command !alerts
if (%wu_command == @alertsinfo) || (%wu_command == @alertinfo) set %wu_command !alertinfo
@B1aderunner The issues you mentioned are on wunderground's side. Look at the xml pages the wunderground script is pulling from:
weather: http://www.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=90210
Forcast: http://www.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=90210
You will see that heat index shows up there as N/A. Not much I can do about that. Sorry.
As for the forecast. It has to do with the detailed forcast, vs the simple forecast tags. It always gets a bit screwed up towards the evening hours local time. I haven't found a fix for that.
As for the wind speed. It only comes in MPH (see tag) In your msg $chan part, you will just need to do some calculation to get it correct.
var %wu_wind_kmh = %wu_wind_mph * 1.609344
@ryan7461035 !twitter v1.6 released. It includes the on/off function.
My bad for giving you bad direction. It needed to be placed in the "if (%t_2 != $null)" Section. I had copied/pasted from my wunderground script and didn't test it.
The v1.6 should work. It is set up for each individual channel of each network. (Aka you can be on irc.hawkee.net with twitter off on #bestchanever. But still have twitter on and working on irc.efnet.net's #bestchanever)
Hope this helps.
@ryan7461035 Below is code you can add into the 'Main code' section to give you the option to turn it off per channel.
;;;---Below is used to turn the script on or off, but only if user is an op of a channel ---
if (%t_2 == on) || (%t_2 == off) && (%t_nick isop %t_chan) {
if (%t_2 == on) {
set $+(%,twitter_,%t_chan) ON
.notice %t_nick !twitter script is now ON
twitter_cleanup
halt
}
if (%t_2 == off) {
set $+(%,twitter_,%t_chan) OFF
.notice %t_nick !twitter script is now OFF
twitter_cleanup
halt
}
} ;end of %t_on/off
;--- Checks if twitter is suppost to be OFF for the channel --
if ($($+(%,twitter_,%t_chan),2) == OFF) {
twitter_cleanup
halt
}
@ryan7461035 In the top area in the ;;; Network line. you could add a simular line for the chan and network. and have the line say simply t_cleanup | halt.
as for a switch function, who would you want to be able to control it? ops only of said chan? I will follow up next week when i am back near a computer. cant edit well on a smart phone :p
@RicJames Ok, Fixed the !w problem. I just uploaded v4.1 to fix that error.
Or just take the space out in lines 50, and 53.
on $*:INPUT:#: {
if ($regex($1,/^[!](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si)) wunderground $1-
}
on $*:text:/^[!](w|weather|forecast|forecast5|alert|alerts|alertinfo|alertsinfo|time|current)/Si:#: {
wunderground $1-
@RicJames No offense intended. I just look towards the obvious problems before diving deep in.
If I understand your first problem correctly. The !w is not working with registered users? I believe this stems back to the starting on:TEXT: line. I was having problems with the weather script responding to any command that started with a !w. ( Say !work, !whois, !wasted, etc) So I put a space after it. I will need to look at that more.
I am unclear as to the issue you are having with the WHILE inside the !alertinfo response. Could you elaborate further?
@RicJames The !w only works if the person/$nick is already registered with the BOT hosting the script and not the NickServ of that network. Have you !w REGISTER 90210 <-- to the $nick you are testing with?
@DragonHeart version 3.0 posted. It now includes !justplaying script.
Let me know if there are any bugs in it.
@RicJames Looks like you have an extra 'IF' in that line.
Yours:
if (%wu_command == !weather) || (%wu_command == !current) || (%wu_command == !time) || if (%wu_command == !w) {
Corrected:
if (%wu_command == !weather) || (%wu_command == !current) || (%wu_command == !time) || (%wu_command == !w) {
@DragonHeart I did once in the past. And I am not sure where it is at the moment. (Gonna have to dig through my files) Thou I do recall, it uses the admin.cgi data page which requires a server user name and password.
Do you operate the server you want the song history for, or is it someone elses? If its some one elses, I will have try and create one for the public song history page, which may be a few as my schedule is busy.
@Yawhatnever Line 68 is ment to be commented out. It is a detailed 'status' giving you all the stats on the station. vs line 67 which only tells you if the station is online or offline.
and yes, on line 33, it has been corrected to %np_nick. I have had made this script years ago, but finally got around to posting it. So I may of messed up a few areas. Let me know if you find anything else.
@KilllerX I have a secondary script that works to prevent it.
The second line in the main alias code shows ;botabuse. Just remove the semi-collan and add the following script alias. This limits how many times someone can activate the bot before it will ignore the user.
That code is here:
http://www.hawkee.com/snippet/7858/
If that won't work, let me know and I can adjust.
@ Bladerunner
Change the following section of code. (The 'Command Prep.' Section, located between lines 126 thru 150)
;---Command Prep. Checks command to see which data file it will be pulling from depending on command entered ---
set %wu_address $replace(%wu_location,$chr(32),$chr(43))
;It now changes not only !w, but also !weather to respond as a !current command
if (%wu_command == !w) || (%wu_command == !weather) set %wu_command !current
if (%wu_command == !current) || (%wu_command == !time) {
set %wu_link $+(/auto/wui/geo/WXCurrentObXML/index.xml?query=,%wu_address)
set %wu_host api.wunderground.com
sockopen wunderground %wu_host 80
}
if (%wu_command == !forecast) || (%wu_command == !forecast5) {
set %wu_link $+(/auto/wui/geo/ForecastXML/index.xml?query=,%wu_address)
set %wu_host www.wunderground.com
sockopen wunderground %wu_host 80
}
if (%wu_command == !alert) set %wu_command !alerts
if (%wu_command == !alertsinfo) set %wu_command !alertinfo
if (%wu_command == !alerts) || (%wu_command == !alertinfo) {
set %wu_link $+(/auto/wui/geo/AlertsXML/index.xml?query=,%wu_address)
set %wu_host www.wunderground.com
sockopen wunderground %wu_host 80
}
;echo -s LINK: %wu_link
}