|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
Hi, I've got my DLL working using $com and it gives me the weather information for the zip code I give it, but I'm also getting this line in the status window: 1 Unknown command Any ideas what's doing that or how to stop it? My remote is this
on 1:text:!weather*:#:{
if ($network == BlakeNET) {
if ($com(weather)) {
var %zip = $2
$com(weather,GetWeather,3,bstr,%zip)
msg botserv say $chan $com(weather).result
}
else {
comopen weather weather.GWeather
var %zip = $2
$com(weather,GetWeather,3,bstr,%zip)
msg botserv say $chan $com(weather).result
}
}
}
I'd also like to format the text in the result so that the "data types" words are bold and in green, and my mind isn't coming up with it right now. A sample output of how it is now would be: Temp: 51 Feels Like: 51 Conditions: Cloudy Wind From: NE at 3MPH Gusting to N/A MPH I'd like the words like "Temp:" and "Feels Like:" to be bold and green. How do I separate the output and just bold and color the "titles"? Thanks.
Last edited by bwr30060; 17/04/06 04:34 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
For the 1 unknown command, I suggest you look elsewhere, as there's nothing in that script that would produce that error. Check the exact message that comes up, as it's an unknown command error, it should indicate what script and line it's coming from.
Regarding the bold & green highlighting, you'd have to pull those words out of the results that are returned, then put in the bold & green highlighting before displaying the information to the channel.
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
Actually that error doesn't say what line. It's white text too, not red like the usual error messges that have line numbers. I'm thinking it might be one of the $com lines in that script, since some things with $com return a 1 or 0 depending on if they were successful, and the 3 parameter in the one line tells mIRC to process the result (I think). I'll have to play with it some more, and maybe I can use a different method number to get rid of that problem. Thanks for your help. How would you suggest putting the bold and green in? I was thinking of tokenizing the result and running each word through "if" statements. Would that be the best idea? Thanks.
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
Store the output in a var and use replace?
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
The line $com(weather,GetWeather,3,bstr,%zip) is an identifier, it is replaced by its result aka 1 = ok, 0 = fail., the 1 (or 0) is then looked at as a command, is not found locally so sent to the IRC server for remote command checking, this finds no command "1" so replies with "1 Unknown command"... solution !.echo -q $com(weather,GetWeather,3,bstr,%zip)And for the 2nd problem the line msg botserv say $chan $com(weather).result can be replaced with [b]msg botserv say $chan $replace($com(weather).result,Temp:,3Temp:,Feels Like:,3Feels Like:)
|
|
|
|
Joined: May 2005
Posts: 449
Fjord artisan
|
OP
Fjord artisan
Joined: May 2005
Posts: 449 |
Thanks for the help. That worked for the "unknown command problem. As for the color problem, I decided to just handle it at the DLL level. I made the changes in the DLL code to make it bold and blue. I went with blue instead of green because it was easier on the eyes. A sample line looks like this now: Temp: 52 Feels Like: 52 Conditions: Mostly Cloudy Wind From: ENE at 12 MPH Gusting To: 17 MPH
|
|
|
|
Joined: Feb 2005
Posts: 681
Fjord artisan
|
Fjord artisan
Joined: Feb 2005
Posts: 681 |
noop $com(weather,GetWeather,3,bstr,%zip)
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
yeah i know, but untill 6.17 comes out with a bugfix on other things, im gonna leave it using a method I know works
heres another one i seen... (just for sag)
$iif( $com(weather,GetWeather,3,bstr,%zip) ,)
|
|
|
|
|