07/05/2024, 13:14 (Modification du message : 07/05/2024, 13:15 par CrazyCat.)
(07/05/2024, 12:17)aslpls a écrit : Hi @Crazycat
You know, a forum as multiple participant, don't ask only one to help you, ask the community.
(07/05/2024, 12:17)aslpls a écrit : i can post the whole code in here because it says, Please correct the following errors before continuing:
You're not allowed to put url in the post
This is because you have not enough posts, this is an antispam rule
Just add the following lines in your script:
tcl
# Set the city you wantset wcity "London"# Set the chan you wantset wchan "#mychan"proc aweather {min hour day month dow}{
weather $botnick[getchanhost $botnick$::wchan]$botnick$::wchan$::wcity}
bind cron - "*/30 * * * *" aweather
08/05/2024, 10:18 (Modification du message : 08/05/2024, 10:19 par aslpls.)
tcl
# Set the city you wantset wcity "London"# Set the chan you wantset wchan "#mychan"proc aweather {min hour day month dow}{
weather $botnick[getchanhost $botnick$::wchan]$botnick$::wchan$::wcity}
bind cron - "*/30 * * * *" aweather
the cron is not showing from the channel, but there's no error after all. if anyone knows what's the matter, please help.
Did you well set the city and the chan ?
And has the chan the +weather flag ? The cron just call the main proc, so the script must be enabled on the chan.
Ok, there is an error, strange you don't get it in partyline:
Code :
[15:24:00] Tcl error [aweather]: can't read "botnick": no such variable
Tested with the new proc:
tcl
# Set the city you wantset wcity "Paris"# Set the chan you wantset wchan "#test"proc aweather {min hour day month dow}{
weather $::botnick[getchanhost $::botnick$::wchan]$::botnick$::wchan$::wcity}# think to change the /2 for /30
bind cron - "*/2 * * * *" aweather
Code :
15:23:19 <+CrazyCat> !w london
15:23:20 <pyegg> london, GB -- Temperature: 19.12 °C / Humidity: 57 % / Wind speed: 2.06 km/h / Cloud cover: 75 % (cer fragmentat). Astronomy (Sunrise: 06:19 / Sunset: 21:34) - Last update: 29 seconds
15:26:00 <pyegg> Paris, FR -- Temperature: 13.09 °C / Humidity: 76 % / Wind speed: 4.63 km/h / Cloud cover: 100 % (cer acoperit de nori). Astronomy (Sunrise: 06:18 / Sunset: 21:15) - Last update: 4 minutes 34 seconds
15:28:01 <pyegg> Paris, FR -- Temperature: 13.09 °C / Humidity: 76 % / Wind speed: 4.63 km/h / Cloud cover: 100 % (cer acoperit de nori). Astronomy (Sunrise: 06:18 / Sunset: 21:15) - Last update: 7 minutes 35 seconds