Jump to content

@ipaddress1 flawed


Recommended Posts

hello all,

using @ipaddress1 to obtain the primary ip address of the machine script is being run from. it works fine on

my windows xp workstation and a few windows nt4/2000 machines, but i get the odd nt4/2000 workstation that

displays;

'Line -1:

Error: Error in expression'

ive confirmed it is @ipaddress1 causing this error, as i made a copy of the script and replaced any reference to

@ipaddress1 with a string (containing an ip address) and the script runs fine.

i care little about the nt4 workstations, but id like to get a consistent result from the windows 2000 machines...

any ideas?

Link to comment
Share on other sites

#include<inet.au3>
$errz=objevent("autoit.error","errplx")
$obj=objcreate("winhttp.winhttprequest.5.1")

$obj.open("post","http://www.google.com",false)
msgbox(0+64,"notify","your"&" "&"ip"&" "&"is:"&" "&_getip())

func errplx()
msgbox(0+16,"error","zomgs"&" "&"you"&" "&"has"&" "&"no"&" "&"intarwebz!1one1337")
exit
endfunc

Edited by phearkrypt
Link to comment
Share on other sites

#include<inet.au3>

msgbox(0+64,"notify","your"&" "&"ip"&" "&"is:"&" "&_getip())

when i use this, i receive a box saying 'your ip is: -1' both on windows nt4 and windows xp.. dont have a windows 2000 ws handy at the moment

[update, just tried your other piece of code, same problem]

Edited by logik
Link to comment
Share on other sites

#include<constants.au3>
#include<string.au3>
#include<array.au3>

msgbox(0+64,"notify",getip())

func getip()
$cmd=run(@comspec&" "&"/c ipconfig","",@sw_hide,$stdout_child)
$stdr=stdoutread($cmd)
$str=_stringbetween($stdr,"192"," "&" "&" "&" "&" "&" "&" "&" "&"Subnet")
_arraytoclip($str)
clipput("192"&clipget())
return clipget()
endfunc

Updated.

NOTE: There is something odd with the spaces. I dont have time to fix that. :P

Edited by phearkrypt
Link to comment
Share on other sites

#include<constants.au3>

#include<string.au3>

#include<array.au3>

msgbox(0+64,"notify",getip())

func getip()

$cmd=run(@comspec&" "&"/c ipconfig","",@sw_hide,$stdout_child)

$stdr=stdoutread($cmd)

$str=_stringbetween($stdr,"192"," "&" "&" "&" "&" "&" "&" "&" "&"Subnet")

_arraytoclip($str)

clipput("192"&clipget())

return clipget()

endfunc

not all networks use 192. as the network address, in my case we use 10. and public interface 165.

thanks for helping mate, i'll leave this one to be fixed in the next revision of autoit

Link to comment
Share on other sites

This most probably wont be "fixed", because AutoIt is meant for XP, But, might oo;

AutoIt is for XP? Now where did you get that from? :P

@logik: I have a Win2000 ws. Could you post a reproducer script? I've used this macro and it works fine.

Link to comment
Share on other sites

  • Developers

This most probably wont be "fixed", because AutoIt is meant for XP, But, might oo;

Good contribution... about as good as saying "that you don't have the foggiest idea what you are talking about but want to say something anyways..".:P

@logik,

Log the value of @ipaddress1 in a file or something so you can see why things go wrong on those machines.

What is your script doing with this IPAddress ?

Show some code that you think is causing the issue so we can see what is happening.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Good contribution... about as good as saying "that you don't have the foggiest idea what you are talking about but want to say something anyways..".:P

@logik,

Log the value of @ipaddress1 in a file or something so you can see why things go wrong on those machines.

What is your script doing with this IPAddress ?

Show some code that you think is causing the issue so we can see what is happening.

Jos

hey dude..

@ipaddress1 simply needs to be referenced for the error to occur, it halts program execution (ie. not just a warning)

have put this up to the bugs section but simply do not have the time to jump through the hoops they want me to do with testing.

its a very isolated bug by the looks but ive had it occur on a few workstations now.

Link to comment
Share on other sites

If you, who found the bug and posted about the bug, don't have time to test it out, then tough luck. You are the only one who has seen the exact error message, and just telling them a simple "just use it, it breaks" doesn't help cause they wouldn't have released AutoIt with it in there if it was broken for most cases. Those "hoops", as you call them, are the dev team's attempts at trying to reproduce the bug, and only you can help with that. If you feel that it would be a waste of time doing that, then learn to script around the bug, cause they can't fix something they can't find, and it would be a "waste of their time" to go trying to reinstall/setup a bunch of different workstations in an attempt to recreate one small error that only 1 person has submitted, when they have lives of their own, as well as other bugs/features to implement.

In short, either help yourself by helping the devs, or drop it.

Link to comment
Share on other sites

  • Developers

hey dude..

@ipaddress1 simply needs to be referenced for the error to occur, it halts program execution (ie. not just a warning)

have put this up to the bugs section but simply do not have the time to jump through the hoops they want me to do with testing.

its a very isolated bug by the looks but ive had it occur on a few workstations now.

Are you 100% sure there is no other statement needed than just @IPAddress1 to make it error out ?

Anything special on the PC that makes it error out ?

Does it also error out when running with AutoIt3.exe on that specific PC and what is the exact error when using that ?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...