mIRC Home    About    Download    Register    News    Help

Print Thread
#159018 12/09/06 03:46 PM
Joined: Jul 2006
Posts: 26
I
Inky Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2006
Posts: 26
I've seen a few people online with weather scripts, you say
!weather <place> and it comes up with the weather for that area, however Ive noticed some aren't very accurate.

How do I make one of these scripts? Im new to mIRC, and don't know how to link scripts with sites. (at least thats what I think they do).

Please could someone teach me, or provide me with a weather script?


Very new to mIRC, don't know much.
#159019 12/09/06 04:39 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You need to learn sockets. mircscripts.org has some good sockets tutorials if you want to learn. They are a more advanced thing to learn, but if you know mIRC scripting pretty well, then learning it isn't too difficult.

If you would like a weather script, you can check out mine: http://www.kakkoiitranslations.net/mircscripts/ and select the IRCWeather script.


Invision Support
#Invision on irc.irchighway.net
#159020 12/09/06 07:26 PM
Joined: Jul 2006
Posts: 26
I
Inky Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2006
Posts: 26
Um....I'm still really learning scripting.

I just want a script so that I type: @Weather <place>, it comes up with the weather on a channel, not popups. Riamus, that script looks good, but its kinda confusing to load.


Very new to mIRC, don't know much.
#159021 12/09/06 08:15 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Ok before you learn how to script you should learn how to load one because this is how you learn to script.

A simple load of a script and understanding how it works leads you to develop your own scripting "Skills"

Always look for a .mrc extension this is usually the one you have to load, on some scripts theres multiple .mrc extensions however you should stand out and say load.mrc or start.mrc or setup.mrc

If your still confuse on how to load them extract the script to your mIRC dir. Now the 2 methods of loading the scripts are with your mouse or typing a command.

#1 Hold ALT press R on your keyboard, click on the Remote tab, click File, load, and go get the .mrc script you extracted

#2 typing /load -rs scriptname.mrc will automatically install the script to your remotes.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#159022 12/09/06 10:35 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Read the included HLP file. It explains how to load the script into mIRC. It also tells you how to use the script.

Also, make sure that you got the correct version. The GUI (User Version) will only work if you have someone (or a bot) running the Server Version. You can run the Server Version yourself, if you want to. Note that you cannot do !weather from the bot.


Invision Support
#Invision on irc.irchighway.net
#159023 13/09/06 08:56 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
I tried your script Riamus, since you did make me curious.

I like the script in general, only found a few small bugs.
It doesn't seem to be possible to set the default format for the !forecast command to International instead of US format. Since this is possible for the normal !weather command, I think it should be added for the !forecast command as well.

When I used the -SI switch in combination with the !forecast command, almost all info was changed to celcius, except for the last day of the forecast. It was still in fahrenheit:
Wednesday: 27 °C and Chance of Rain (30%), Thursday: 26 °C and Partly Cloudy, Friday: 25 °C and Partly Cloudy, Saturday: 20 °C and Clear, Sunday: 19 °F and Overcast

When I used !weather city, country with default (US) format.
Wind Chill came up with nothing, but it wasn't replaced with N/A (which is supposed to happen afaik):
....Temp: 68 °F, Wind Chill: °F, Dew Point: 64 °F,....

I also think it sends a little bit to much information after every request. It would be good to be able to switch off the !help notice after every request. And the !help command itself could be a little shorter imo. More to the point.

I used the user version btw (loaded on a bot).
Anyway, like I said, I do like the script, and I will keep using it.
Just wanted to give you some feedback.

#159024 13/09/06 10:21 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Hm... I thought I did have the UK version setting for forecast as well. I'll look into that and probably release an updated version for it.

The -SI actually works based on what you're showing me, but it's displaying the F instead of C. I'll fix that as well. As I don't use that myself, I just didn't notice the mistake. Thanks.

As for some data sometimes missing like you mentioned, I've tried to get that straightened out without much luck. It depends on the lag getting to the site. If it takes too long, you tend to be missing some data for some reason and yet the script treats it as not being N/A. I'll continue to try and figure that one out.

Turning off the notice after each message would probably be a good idea for an option. I'll have to consider that and decide how best to do that.

As for the !help message, if you have a better way to write it, feel free to let me know. smile

And, thank you for the feedback. It's nice having feedback on scripts that take a long time to write. As you can see from the version history, that script has been revised many times with new features, bug fixes, and changes due to the website changing.


Invision Support
#Invision on irc.irchighway.net
#159025 15/09/06 12:14 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, check for updates and the SI stuff will be fixed. I am not sure how to really reduce the !help information for people who haven't used this script and still have it be helpful. Also, I'm not sure the best way to allow removing the notice when people use the trigger. I want everyone to see it at least once in awhile as it reminds them of the help command and where they can get the GUI part.


Invision Support
#Invision on irc.irchighway.net
#159026 15/09/06 03:31 PM
Joined: Jul 2006
Posts: 26
I
Inky Offline OP
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jul 2006
Posts: 26
I DO know how to load scripts, ones I have downloaded into my mIRC folder, but I just don't actually know HOW to script. I know the starting:
on *:TEXT:<command>:* and so on...
And also $nick, $chan and /notice, but I really need to find a good site that teaches me...how did you guys learn scripting?


Very new to mIRC, don't know much.
#159027 15/09/06 07:40 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Very nice. I just updated the script, and it looks slick Riamus.
About the help file, I also think the information should be there, but maybe just a little shorter, something like:

<Bot> IRC Weather HELP:
<Bot> !weather <ZIPCODE> | <CITY, STATE> | <CITY, COUNTRY>
<Bot> !forecast <ZIPCODE> | <CITY, STATE> | <CITY, COUNTRY>
<Bot> Use -si switch to switch to Celsius, kilometers, etc... Example: !weather -si Paris, France
<Bot> Get the GRAPHICAL INTERFACE! for this script at http://www.KakkoiiTranslations.net/mircscripts/

I dunno, just an idea.
With the GUI being mentioned in the help file, I think you could remove it from the notice. But ok, I like it as it is mate. Nice script.

#159028 15/09/06 07:46 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Inky, I think the best way is to read these forums.
Skip the stuff that doesn't make sense, but concentrate on the stuff that does make sense.

You can also copy some of the codes that you find here, and play with it a little. Make same changes and see what it does. By testing and trying you learn most.

And start trying to write some of your own codes. Set a challange for yourself, and keep trying till you got it working grin

Btw, your new bible is the mIRC helpfile cool

#159029 15/09/06 11:11 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
What you're showing is only 1 line shorter. I could drop the part about using /msg to get it in a private message, but it's nice to have people know they can do that so that they don't have to fill up the channel all the time. And I do like to have the help file explain things a bit better. Remember that you have a HLP file with information... visitors who use the script off your bot don't.

I may consider how I could change it to be clearer in a shorter space, but we'll see what happens.


Invision Support
#Invision on irc.irchighway.net
#159030 15/09/06 11:15 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Inky, I learned by viewing other people's scripts. I actually started by using TrivBot and deciding that I wanted it to do some things differently. So I used the mIRC help file and asked questions here and in #scripting channels as I worked out how to get things done.

Keep in mind that I have a lot of programming experience in other languages already, so this wasn't that hard to learn for the basics and the help file is really great if you have an idea of what you are looking for.

Whenever I wanted to try something new, I usually got someone else's script that did what I wanted to try and saw how it worked and then played around with it until it did what I wanted it to. Sometimes, I just learned by the help file, of course.

The best thing you can do is to learn to use ECHOs to troubleshoot. If something isn't working, try inserting an echo at different points in the script to echo out "testing" or a variable or whatever else so that you can figure out where the script is failing.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard