Jump to content
Sign in to follow this  
Berend Jan

calculate right amount

Recommended Posts

hi guys,

I have this:

Func _Bank()
        Mouseclickdrag ("left", $LocScrollDown1, $LocScrollDown2, $LocScrollDown3, $LocScrollDown4)
    Mouseclickdrag ("left", $LocDragGeld1, $LocDragGeld2, $LocDragGeld3, $LocDragGeld4)
    Send ("^c")
    Run ("Notepad.exe")
    sleep (5000)
    Send ("^v")
    Send ("{LEFT}{LEFT}{LEFT}{BS}{LEFT}{LEFT}{LEFT}{BS}{LEFT}{LEFT}{LEFT}{BS}{LEFT}{BS}{BS}{BS}{BS}{BS}{BS}


{BS}{BS}{BS}{BS}{BS}")
    Send ("^a")
    Send ("^c")
    $Money = ClipGet()
        If $Money >= 200000000 Then
            ProcessClose("notepad.exe")
            WinActivate ("Mobstar mafia game - Microsoft Internet Explorer", "")
            Mouseclick ("left", $LocBank1, $LocBank2, 1)
        ;_WaitForWebPage()
            Sleep (5000)
            Mouseclick ("left", $LocStort1, $LocStort2, 1)
            Send ($Bankmoney)
            Mouseclick ("left", $Stortbedrag1, $Stortbedrag2, 1)
        ;_WaitForWebPage()
            Sleep (5000)
        Else
            $LowMoney = $Money - 200000
            ProcessClose("notepad.exe")
            WinActivate ("Mobstar mafia game - Microsoft Internet Explorer", "")
            Mouseclick ("left", $LocBank1, $LocBank2, 1)
        ;_WaitForWebPage()
            Sleep (5000)
            Mouseclick ("left", $LocStort1, $LocStort2, 1)
            Send ($LowMoney)
            Mouseclick ("left", $Stortbedrag1, $Stortbedrag2, 1)
        ;_WaitForWebPage()
            Sleep (5000)
        EndIf
EndFunc

The point is that the amount that is being copied on line 10 will be "scanned" and when the amount is higher than 200000000, 200 mill will be put in at Send ($Bankmoney). Though for some reason the script always takes the Else command and then puts in -200000 when the amount is higher than 200000000. When the amount is lower then 200000000 is does do the job correctly.

Could any of you explain the problem i'm having?

Berend Jan

Share this post


Link to post
Share on other sites

try putting the following right after the line clipget and see what your return is

$Money = ClipGet()
     ConsoleWrite($Money & @LF)

in testing it seems to work here if i have the number in the clip.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

try putting the following right after the line clipget and see what your return is

$Money = ClipGet()
     ConsoleWrite($Money & @LF)

in testing it seems to work here if i have the number in the clip.

<{POST_SNAPBACK}>

This gives me a error as respons: unknown function name :(

Share this post


Link to post
Share on other sites

ConsoleWrite() is an included function in version 3.1.1 of Autoit. This is the latest public release version.

Though, the editor used, needs to support it, for it's use.

:(

Share this post


Link to post
Share on other sites

oops, used to using beta version

replace the ConsoleWrite($Money & @LF)

with

MsgBox(0,"test",$Money)

<{POST_SNAPBACK}>

it does copy the right amount. It shows in the msgbox. don't understand why it puts in -200000 then. does anyone of you do?

Berend Jan

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...