Jump to content

Problem with If ... elseif ... else


Recommended Posts

Hi.

Here is piece of my script:

If $gorjacarjev >= $gorjacar And $paladinov >= $paladin And $metalcev >= $metalec Then
        MsgBox(0, "lol", $gorjacarjev& " >= " &$gorjacar& " in " &$paladinov& " >= " &$paladin& " in " &$metalcev& " >= " &$metalec, 50)
        _IENavigate($ie, "http://speed.travian.si/a2b.php")
        $ngorjacar = _IEGetObjByName($ie, "t1")
        $npaladin = _IEGetObjByName($ie, "t5")
        $nmetalec = _IEGetObjByName($ie, "t3")
        $nx = _IEGetObjByName($ie, "x")
        $ny = _IEGetObjByName($ie, "y")
        _IEFormElementSetValue($ngorjacar, $gorjacar)
        _IEFormElementSetValue($npaladin, $paladin)
        _IEFormElementSetValue($nmetalec, $metalec)
        _IEFormElementSetValue($nx, $x)
        _IEFormElementSetValue($ny, $y)
        $form = _IEFormGetObjByName($ie, "snd")
        _IEFormElementRadioSelect($form, 4, "c")
        $ok = _IEGetObjByName($ie, "s1")
        _IEAction($ok, "click")
        _IELoadWait($ie)
        $send = _IEGetObjByName($ie, "s1")
        _IEAction($send, "click")
        _IELoadWait($ie)
    ElseIf $gorjacarjev2 >= $gorjacar2 Then
        MsgBox(0, "Lol", "dvojka "&$gorjacarjev2&" >= "&$gorjacar2, 50)
        _IENavigate($ie, "http://speed.travian.si/a2b.php")
        $ngorjacar = _IEGetObjByName($ie, "t1")
        $nx = _IEGetObjByName($ie, "x")
        $ny = _IEGetObjByName($ie, "y")
        _IEFormElementSetValue($ngorjacar, $gorjacar2)
        _IEFormElementSetValue($nx, $x)
        _IEFormElementSetValue($ny, $y)
        $form = _IEFormGetObjByName($ie, "snd")
        _IEFormElementRadioSelect($form, 4, "c")
        $ok = _IEGetObjByName($ie, "s1")
        _IEAction($ok, "click")
        _IELoadWait($ie)
        $send = _IEGetObjByName($ie, "s1")
        _IEAction($send, "click")
        _IELoadWait($ie)
    ElseIf $paladinov2 >= $paladin2 Then
        MsgBox(0, "Lol", "trojka "&$paladinov2&" >= "&$paladin2, 50)
        _IENavigate($ie, "http://speed.travian.si/a2b.php")
        $npaladin = _IEGetObjByName($ie, "t5")
        $nx = _IEGetObjByName($ie, "x")
        $ny = _IEGetObjByName($ie, "y")
        _IEFormElementSetValue($npaladin, $paladin2)
        _IEFormElementSetValue($nx, $x)
        _IEFormElementSetValue($ny, $y)
        $form = _IEFormGetObjByName($ie, "snd")
        _IEFormElementRadioSelect($form, 4, "c")
        $ok = _IEGetObjByName($ie, "s1")
        _IEAction($ok, "click")
        _IELoadWait($ie)
        $send = _IEGetObjByName($ie, "s1")
        _IEAction($send, "click")
        _IELoadWait($ie)
    ElseIf $metalcev2 >= $metalec2 Then
        MsgBox(0, "Lol", "sterka "&$metalcev2&" >= "&$metalec2, 50)
        _IENavigate($ie, "http://speed.travian.si/a2b.php")
        $nmetalec = _IEGetObjByName($ie, "t3")
        $nx = _IEGetObjByName($ie, "x")
        $ny = _IEGetObjByName($ie, "y")
        _IEFormElementSetValue($nmetalec, $metalec2)
        _IEFormElementSetValue($nx, $x)
        _IEFormElementSetValue($ny, $y)
        $form = _IEFormGetObjByName($ie, "snd")
        _IEFormElementRadioSelect($form, 4, "c")
        $ok = _IEGetObjByName($ie, "s1")
        _IEAction($ok, "click")
        _IELoadWait($ie)
        $send = _IEGetObjByName($ie, "s1")
        _IEAction($send, "click")
        _IELoadWait($ie)
    Else 
        MsgBox(0, "lol", "sleep", 50)
        Sleep(60000)
    EndIfoÝ÷ Ù8^¦ºé¢²)í+%w¬[7ê
+§®7¯Ú

Please I need help ... if you dont understand something just ask ... thx

Link to comment
Share on other sites

  • Developers

"6" is bigger than "10"

So likely you are comparing strings in stead on numbers.

Use Number() to convert them.

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

... maybe its getting "1" from each and it "=" eachothers... say you get 1 when something is true... and 0 when its false.

Link to comment
Share on other sites

  • Developers

... maybe its getting "1" from each and it "=" eachothers... say you get 1 when something is true... and 0 when its false.

Could you run this by us again but this time slowly? :D

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

im not uhh.. familliar with IE commands.. so PROBABLY i am wrong but what i was saying was maybe its the function status that its checking and not the value.. say the function is true then it would be 1 false it would be 0 or another value...

never mind ill learn more areas of autoit haha

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...