• You've been granted Beta access to this site, allowing you to explore some of the new features while they're still under construction. More information can be found in the Beta forum.

I need a little coding help....

JohnWPB

Active Member
I have been using HS for around 6 years, and that can actually be a bad thing. Let me explain, I did not know a single thing about VB script, until I needed it to do some things I wanted in HS. Now, 6 years later, I can write just about anything in VB.... well HS VB that is! There are subtle diferences in true VB and commands that HS can use. I found this to be true when I would write ASP pages that worked fine in HS, but would not work on a server.

So.... here is my problem, I wrote a script to grab weather images, and save them locally. It works fine in HS, but I can not get it to run outside HS. I have looked the code over, and just do not see what is causing this. If someone could take a look, and let me know, I would greatly appreceiate it.

This is actually for my CarPC. I have Wi-Fi Hopper installed, It will auto detect my home network when I start the car and grab the images when I leave the house. I could also connect with my cellphone as a blue tooth modem, and it would also be detected and grab the images automatically. Also whenever an unsecured Wi-Fi signal is detected while driving around, Wi-Fi Hopper will automatically connect to it, and can trigger this script to update the imagesimages. Next are images from local area traffic cams.

Note: Right now, as it stands, this script will work perfectly with HS as it is to grab just about any image and save it locally at whatever interval you tell HS to run the script. This can make loading local weather pages much faster with the images cached to your hard drive in advance.....


Here is the code, you know it's not much when it's only a 2k zip file!! The "weather.txt" file is basically an INI with the list of Images names & URL's to get them from. The RoadRunnerWeather.vbs is the script.
 

Attachments

  • ImageDownloader.zip
    1 KB · Views: 23

Squintz

Senior Member
Without looking at the code... HS vb has enabled some features that are not typically available in VB script due to security reasons. I forget what it is that they enabled but it has to do with the ability to access files on the local machine. VBScript is typcially a Client side scripting language and you would not want someone to be able to access files on a client machine. But I am guessing if you are using it in an ASP page then you are using it on the Server Side and I am not sure what would cause that. I will take a look when I get home. I am at work and not allowed to DL this type of stuff.
 

JohnWPB

Active Member
Hey Squintz... I am hnot using this script on an ASP page, was just mentioning I had a very similar problem some time back...

Appreceiate the help!
 

harleydude

Active Member
John

I looked at your script and made a couple of changes. Let me know if it works for you.
 

Attachments

  • RoadRunnerWeather.zip
    864 bytes · Views: 22

Rupp

Senior Member
John,
When I attempted to download your file I get a virus detected warning:

Antivirus Alert
The page or file you are trying to reach contains a virus.



--------------------------------------------------------------------------------

The object located at http://www.cocoontech.com/index.php?act=at...e=post&id=45577 has been detected by BitDefender as a possible source of infection.

To maintain the safety of your computer and the Intergraph Network, BitDefender for MS ISA Servers has blocked the access to the specified location.

An alert has been sent to the network administrator.

For more information contact Intergraph Network Services. [email protected]



--------------------------------------------------------------------------------
Technical Information:
Object: http://www.cocoontech.com/index.php?act=at...e=post&id=45577
ISA Server: 129.135.251.220
Server Port: 80
Client: 129.135.186.40
Virus Name: Exploit.ADODB.Stream.Gen
Status: Infected
Action: Delete


Any of you guys seeing this?
 

JohnWPB

Active Member
HarleyDude: Thanks, Will give it a try right now and let you know. Thanks!


Rupp, I think your AV software is WAY over zealous! I just scanned the .zip with AVG, and uncompressed it to a folder, and made sure no files were hidden. Nothing, just 2 plain ascii text files.

Unless there is a new virus that is cabable of launching from a text file, there should be no problems :(

EDIT HarleyDude: That did it! Thank you very much! I was getting an error when I first ran it, due to a End Of FIle problem. I just had to delete the last blank line that was in the weather.text file.

Thanks again!

I notice the only thing changed is the removal of sub(main) and the end(sub) commands... and changing TextStream.close to TheFile.Close. Funny how HS worked with the TextStream.close ok......
 

Rupp

Senior Member
John,
I'm sure you're right. I was at work when I tried and they have just implemented a new VR solution.
 

JohnWPB

Active Member
Ok, now if I can ask one other small resuest. If someone has a compiler to save the script to an exe I would really appreceiate it. I found a few shareware ones on the web, but pop up a nag screen when the exe is run.

I can't see forking out cash for this, as it is something I would probably never use again.

Here is the finished script that needs compiled:
 

Attachments

  • RoadRunnerWeather.zip
    872 bytes · Views: 19
Top