Jump to content
Sign in to follow this  
uk80glue

Script Not Working

Recommended Posts

uk80glue

Friend sent me a script, it's supposed to loop. It's the exact same script he's using and his loops, however mine doesn't. I run the script, it does its thing one time then AutoIt closes. Is there something I'm missing?

Share this post


Link to post
Share on other sites
Yashied
Belfigor

Or show your script to us


[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Share this post


Link to post
Share on other sites
uk80glue

We've been over it like 10 times and for some reason mine just will not loop. It's the exact same script, exact same version of AutoIt.

Share this post


Link to post
Share on other sites
uk80glue

here is the script:

Global $Paused

Global $35check

Global $cratecheck

Global $movecheck

Global $shoecheck

Global $unfinishedcheck

HotKeySet("{PAUSE}", "TogglePause")

HotKeySet("{ESC}", "Terminate")

Opt("MouseClickDragDelay", 100)

#include <Misc.au3>

Sleep("1000") ; Pause to switch to SWG - Windowed Mode

$i = 0 ; Infinite loop

SplashTextOn("Setup", "Leftclick somewhere on screen that turns dark with attach SEA popup", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$popX = $pos[0]

$popY = $pos[1]

Sleep(300)

SplashTextOn("Setup", "Click on the +35 powerbit (left blue side). Make sure the status menu opens", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$modX = $pos[0]

$modY = $pos[1]

Sleep(1000)

SplashTextOn("Setup", "Click just left above Power in the status menu", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$pX = $pos[0]

$pY = $pos[1]

Sleep(1000)

SplashTextOn("Setup", "Click just leftabove the 35 in the status menu", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$35Cx1 = $pos[0]

$35Cy1 = $pos[1]

$35Cx2 = $pos[0] + 14

$35Cy2 = $pos[1] + 10

Sleep(300)

SplashTextOn("Setup", "Leftclick on the spot right of the +35 in inventory, so you'll touch the item you use for grinding", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$mod2X = $pos[0]

$mod2Y = $pos[1]

Sleep(300)

SplashTextOn("Setup", "Leftclick on the +35 Powerbit storage", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$storageX = $pos[0]

$storageY = $pos[1]

Sleep(300)

SplashTextOn("Setup", "Leftclick on the crate of items you use for grinding", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$shoeX = $pos[0]

$shoeY = $pos[1]

Sleep(300)

SplashTextOn("Setup", "Leftclick on the junktool", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$junkX = $pos[0]

$junkY = $pos[1]

Sleep(300)

SplashTextOn("Setup", "Leftclick on the RE tool", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$reX = $pos[0]

$reY = $pos[1]

Sleep(300)

SplashTextOn("Setup", "Leftclick on the unfinished powerbit (storage)", 400, 100, -1, -1, 1, "Ariel", 14)

While 1

Sleep(100)

If _IsPressed("01") Then

$pos = MouseGetPos()

ExitLoop

EndIf

WEnd

SplashOff()

$unfinishedX = $pos[0]

$unfinishedY = $pos[1]

Sleep(300)

MouseClick("left", $modX, $modY, 1, 3)

Sleep(1500)

$pre35check = PixelChecksum($pX, $pY, $pX + 10, $pY + 10)

$35check = PixelChecksum($35Cx1, $35Cy1, $35Cx2, $35Cy2)

$popcheck = PixelGetColor($popX, $popY)

$cratecheck = PixelChecksum($shoeX - 5, $shoeY - 5, $shoeX + 5, $shoeY + 5)

$shoecheck = PixelChecksum($mod2X, $mod2Y, $mod2X + 10, $mod2Y + 10)

$unfinishedcheck = PixelChecksum($unfinishedX - 10, $unfinishedY - 10, $unfinishedX + 10, $unfinishedY + 10)

Sleep(100)

MouseClickDrag("left", $modX, $modY, $storageX, $storageY, 3)

Sleep(1000)

$movecheck = PixelChecksum($modX - 5, $modY - 5, $modX + 5, $modY + 5)

Sleep(1000)

MouseClickDrag("left", $unfinishedX, $unfinishedY, $modX, $modY, 3)

Do

Sleep(100)

Until Not isempty()

Sleep(1000)

Do

MouseClick("left", $modX, $modY, 1, 3)

ToolTip("1", 0, 0)

Do

Sleep(100)

Until PixelChecksum($pX, $pY, $pX + 10, $pY + 10) == $pre35check

ToolTip("")

If check35() Then

Do

MouseClickDrag("left", $modX, $modY, $storageX, $storageY, 3)

Sleep(600)

Until isempty()

Do

If Not unfinishedcheck() Then

Exit 0

EndIf

MouseClickDrag("left", $unfinishedX, $unfinishedY, $modX, $modY, 3)

Sleep(500)

If (isempty()) Then

Sleep(500)

If (isempty()) Then

Sleep(500)

If (isempty()) Then

Sleep(500)

EndIf

EndIf

EndIf

Until Not isempty()

EndIf

If Not cratecheck() Then

Exit 0

EndIf

Do

MouseClickDrag("left", $modX, $modY, $reX, $reY, 3)

Sleep(1000)

Until isempty()

Do

MouseClick("right", $junkX, $junkY, 1, 3)

Sleep(1000)

Send("5")

MouseClick("left", $junkX, $junkY, 1, 3)

Sleep(500)

$xx = 0

Do

Sleep(500)

$xx = $xx + 1

Until Not isempty() Or $xx > 10

Until Not isempty()

Do

MouseClickDrag("left", $modX, $modY, $reX, $reY, 3)

Sleep(1000)

Until isempty()

Do

MouseClick("right", $reX, $reY, 1, 3)

Sleep(1000)

Send("6")

MouseClick("left", $reX, $reY, 1, 3)

Sleep(500)

Until Not isempty()

MouseClick("left", $shoeX, $shoeY, 2, 3)

Sleep(200)

Do

Sleep(500)

Until Not shoecheck()

Do

MouseClickDrag("left", $modX, $modY, $mod2X, $mod2Y, 3)

Sleep(1000)

Until popup()

Send("{enter}")

Do

Sleep(600)

Until Not popup()

Do

MouseClickDrag("left", $modX, $modY, $reX, $reY, 3)

Sleep(1000)

Until isempty()

Do

MouseClick("right", $reX, $reY, 1, 3)

Sleep(1000)

Send("5")

MouseClick("left", $reX, $reY, 1, 3)

Sleep(500)

Until Not isempty()

Until $i = 1

Func check35()

Return PixelChecksum($35Cx1, $35Cy1, $35Cx2, $35Cy2) == $35check

EndFunc ;==>check35

Func shoecheck()

Return PixelChecksum($mod2X, $mod2Y, $mod2X + 10, $mod2Y + 10) == $shoecheck

EndFunc ;==>shoecheck

Func isempty()

Return PixelChecksum($modX - 5, $modY - 5, $modX + 5, $modY + 5) == $movecheck

EndFunc ;==>isempty

Func cratecheck()

Return PixelChecksum($shoeX - 5, $shoeY - 5, $shoeX + 5, $shoeY + 5) == $cratecheck

EndFunc ;==>cratecheck

Func unfinishedcheck()

;Return PixelChecksum($unfinishedX - 5, $unfinishedY - 5, $unfinishedX + 5, $unfinishedY + 5) == $unfinishedcheck

Return True

EndFunc ;==>unfinishedcheck

;Pause Script

Func TogglePause()

$Paused = Not $Paused

While $Paused

Sleep(100)

ToolTip('Script Paused', 0, 0)

WEnd

ToolTip("")

EndFunc ;==>TogglePause

Func popup()

Return PixelGetColor($popX, $popY) <> $popcheck

EndFunc ;==>popup

;Terminate Script

Func Terminate()

Exit 0

EndFunc ;==>Terminate

Share this post


Link to post
Share on other sites
Belfigor

While 1
    Sleep(100)
    If _IsPressed("01") Then
    $pos = MouseGetPos()
    ExitLoop
    EndIf
WEnd

If it detect Left Mouse button click it will auto exit script. Try to change it to somthing else.


[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Share this post


Link to post
Share on other sites
uk80glue

stupid question, but how?

assume i want to change it to the "8" key.

sorry, I've never actually written any scripts or anything before.

Share this post


Link to post
Share on other sites
Belfigor

stupid question, but how?

assume i want to change it to the "8" key.

sorry, I've never actually written any scripts or anything before.

Try to use this

If _IsPressed("38") Then

[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Share this post


Link to post
Share on other sites
uk80glue

cool, ill test this out in a bit and post my results.

thanks for the help.

Share this post


Link to post
Share on other sites
uk80glue

not working, sort of.

I still need to be able to click items in game, now clicking them does nothing.

problem I had before is everything ran smoothly, but it would only work once. the script would run, then at the end instead of looping AutoIt would just close out.

Share this post


Link to post
Share on other sites
Belfigor

well i dont work with spagetty code for a very long time >_<

Post origenal au3 file, it will be more easy to check it

Edited by Belfigor

[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Share this post


Link to post
Share on other sites
uk80glue

http://www.filefront.com/14287269/AutoREing.au3

Share this post


Link to post
Share on other sites
Belfigor

May be there is diferent interface options between you and your friend?

Script will autoexit loop if

cratecheck() <> $cratecheck


[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.