Communauté Eggdrop

Version complète : weather.tcl
Vous consultez actuellement la version basse qualité d’un document. Voir la version complète avec le bon formatage.
Hi @Crazycat

can you help me to add a cron of every 30min to show the weather in specific channel.


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


Please see attached file.
(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 want
set wcity "London"
# Set the chan you want
set wchan "#mychan"
proc aweather {min hour day month dow} {
   weather $botnick [getchanhost $botnick $::wchan] $botnick $::wchan $::wcity
}
bind cron - "*/30 * * * *" aweather


sorry man.. no worries this is noted.

Thanks a lot for the help.
tcl
# Set the city you want
set wcity "London"
# Set the chan you want
set 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.
yes i did.. everything well set. and with the +weather flag
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 want
set wcity "Paris"
# Set the chan you want
set 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
Thank you it is now working..