weather.tcl
#1
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.


Pièces jointes
.tcl   weather-en.tcl (Taille : 5.26 Ko / Téléchargements : 3)
Répondre Avertir
#2
(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


Répondre
#3
sorry man.. no worries this is noted.

Thanks a lot for the help.
Répondre Avertir
#4
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.
Répondre Avertir
#5
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.
Répondre
#6
yes i did.. everything well set. and with the +weather flag
Répondre Avertir
#7
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
Répondre
#8
Thank you it is now working..
Répondre Avertir


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté