Sign in to follow this  
Followers 0
zero57

Is there anyway to improve my Curveball bot?

19 posts in this topic

Hi, I'm wonder if anyone can improve my curveball bot, it works, just that it goes kinda slow.... and its max level is level 2.... xD. Also when i run it, and press the Home button (the start button to start the script) it lags my computer... it goes about like 10 fps? and when I exit it,(pressing the End button) the computer goes back to normal..... Anyways heres my script, please help me improve it.

;hotkeysettings
Global $Paused
HotKeySet("{INSERT}", "TogglePause")
HotKeySet("{HOME}", "Terminate")
HotKeySet("{END}", "StartScript")

;repeating sleep commands so makes enough time to press a hot key
MsgBox(0, "READ ME", "Hello, here are the buttons to start,pause and exit the script. Insert button = pause, :: Home button = Exit, :: End Button = Start the Script.           Hope you have fun, And don't worry i will provide u the link to the game. And also YOU WILL NEED FireFox!!!")
ToolTip("Please wait while firefox loads", 100, 450)
Run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.albinoblacksheep.com/flash/curveball")
Sleep(2000)
ToolTip("Firefox has loaded, Please Press one of the following Buttons: Insert = Pause, Home = Exit, End = Start.    Please Press the start game for me, then press the End button to start the auto playing", 0, 200)

While 1
    Sleep(100)
WEnd

;functions

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause


Func Terminate()
    Exit 0
EndFunc   ;==>Terminate


Func StartScript()
    While 1
        $coord = PixelSearch(271, 217, 735, 525, 0xFFFFFF, 0, 7)
        If IsArray($coord) Then
            MouseClick("left", $coord[0], $coord[1], 1, 0)
        EndIf
        ToolTip("The auto curveball player has started!", 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>StartScript

Don't worry, if you have read the script, it will give u the link to the game. and if you read extra carefully you will need firefox.


[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites



lol, there is an easy way to set the paddle width and height and to freeze the enemy paddle on the spot it's, but what but would you achieve? You can easily set the score to a few billions and that is :).

Share this post


Link to post
Share on other sites

lol, there is an easy way to set the paddle width and height and to freeze the enemy paddle on the spot it's, but what but would you achieve? You can easily set the score to a few billions and that is :) .

I don't really get u.... But my achievement/goal is to make autoit bots for people, and help them out like you guys r helping me out...

but anyways, the reason why i posted this thread is because i wanna see the improvements i could've made in my old bot. And memorize what i have to importantly memorize, isn't that reasonable enough? To learn from ur mistakes or to learn from your old projects and improve them.


[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

Well my guess would be to change the color the Pixel Search is for...

ATM the spot on the ball you are using for color happens to be the exact color of the walls( or within the shade number you have given). Which makes the script want to be in both places.

Possibly narrow the shade limit and use a different part of the ball.

Then you could have another search that happens if first search is unsuccessful ( the ball is behind the paddle). :)

That is how I would do it :)


If you intend to use Sarcasm you must this sticker!!![size="1"][sub]pic made by manadar[/sub][/size]

Share this post


Link to post
Share on other sites

Here, a game you'll never lose and is probably much harder to the enemy. :)

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

AdlibEnable('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibDisable()
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)
    
    If Not $fError Then
        ; Do something with the values
        $oFlash.SetVariable('_level0.userPaddle._width', 2000)
        $oFlash.SetVariable('_level0.userPaddle._height', 2000)
        MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    EndIf
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc

Share this post


Link to post
Share on other sites

Well my guess would be to change the color the Pixel Search is for...

ATM the spot on the ball you are using for color happens to be the exact color of the walls( or within the shade number you have given). Which makes the script want to be in both places.

Possibly narrow the shade limit and use a different part of the ball.

Then you could have another search that happens if first search is unsuccessful ( the ball is behind the paddle). :)

That is how I would do it ;)

Thx, i'll be doing that right now.

Here, a game you'll never lose and is probably much harder to the enemy. :)

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

AdlibEnable('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibDisable()
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)
    
    If Not $fError Then
        ; Do something with the values
        $oFlash.SetVariable('_level0.userPaddle._width', 2000)
        $oFlash.SetVariable('_level0.userPaddle._height', 2000)
        MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    EndIf
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc

Umm... When i tried your script it has errors... I used the latest beta version, and i also tried the latest production version. Maybe you could fix it?

The Errors in the beta version are:

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

AdlibEnable('_TrackBallPos', 30)

and

AdlibDisable()

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

These r in line 30, and line 37.

In Production version, i Go and do the productions version of syntax check and it says everythings ok. Now when i debug the script, it shows this:

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

New AutoIt v3 Script.au3 (14) : ==> Only Object-type variables allowed in a "With" statement.:

With $oFlash

With ^ ERROR

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

This is in line 14.

Please fix these errors.

Production/Release/Public Version: 3.3.0.0

Beta version: 3.3.1.1

Thx.

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

Any more improvements i can make?

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


[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I'm using AutoIt version 3.3.0.0 so I didn't upgrade yet, I'll download and check what needed to be changed.

Edit: Read the changelog next time, didn't test it yet but I guess it works:

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

$oFlash.SetVariable('_level0.userPaddle._width', 2000)
$oFlash.SetVariable('_level0.userPaddle._height', 2000)
AdlibRegister('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibUnRegister('_TrackBallPos')
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)
    
    If Not $fError Then
        MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    EndIf
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc
Edited by Authenticity

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I'm using AutoIt version 3.3.0.0 so I didn't upgrade yet, I'll download and check what needed to be changed.

Edit: Read the changelog next time, didn't test it yet but I guess it works:

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

$oFlash.SetVariable('_level0.userPaddle._width', 2000)
$oFlash.SetVariable('_level0.userPaddle._height', 2000)
AdlibRegister('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibUnRegister('_TrackBallPos')
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)
    
    If Not $fError Then
        MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    EndIf
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc

Hmm now everythings fixed for beta, and same for release version. But when I ran it, it showed this.

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

C:\Documents and Settings\polam\Desktop\New AutoIt v3 Script.au3(32,34) : ERROR: AdlibRegister(): undefined function.

AdlibRegister('_TrackBallPos', 30)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\polam\Desktop\New AutoIt v3 Script.au3(39,36) : ERROR: AdlibUnRegister(): undefined function.

AdlibUnRegister('_TrackBallPos')

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\polam\Desktop\New AutoIt v3 Script.au3 - 2 error(s), 0 warning(s)

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

Somethings wrong with adlibregister and unregister...

Also im using SciTe If that makes any difference.

3 things i have for autoit:

Release version: 3.3.0.0

Beta version: 3.3.1.1

SciTe

Dunno if there is a version for SciTe but i think i have the latest one.

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

Edit: Oh ya, is there any way, any way, of possibly telling or a program that knows what shade the colour is? I mean i want the exact shade number. Or do i have to just play around with the shade number?

Please answer this question too.

Edited by zero57

[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

It seems like you'll need to find those changes that make the difference between the release and the beta versions. Maybe the function description can help you better. About the shade color, you don't need it because a color is just 4 bytes long. In regard to the alpha or hue or saturation or tint or whatever the color is the same 4 bytes you see there. You can use AutoIt Info (Ctrl + F6 from SciTE) to get the color currently under the mouse, it's under the Mouse tab.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

It seems like you'll need to find those changes that make the difference between the release and the beta versions. Maybe the function description can help you better. About the shade color, you don't need it because a color is just 4 bytes long. In regard to the alpha or hue or saturation or tint or whatever the color is the same 4 bytes you see there. You can use AutoIt Info (Ctrl + F6 from SciTE) to get the color currently under the mouse, it's under the Mouse tab.

I already tryed both but i'll see what i can do to make it work. Thx.

I already know how to get the colour too. Yes, the Autoit Window Info. It's so handy that i can't even explain how it works o.o . Soooo i just play with the shade colour number? or do i just give it a 0 and leave it there? Cuz i seen some bots that has around 5-ish.

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

Edit: Hey I re-read ur post at the top where my post started. about the part:

"lol, there is an easy way to set the paddle width and height and to freeze the enemy paddle on the spot it's, but what but would you achieve? You can easily set the score to a few billions and that is :)."

Soo how do u set the paddle width and height and to freeze the enemy paddle on the spot?

If you think ur "trick" is too good to share, maybe u can PM me the trick? Or u can post it on here :). Or were u just saying that as a joke?

Edited by zero57

[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

Nope :) it wasn't a joke. It's cheap:

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

$oFlash.SetVariable('_level0.userPaddle._width', 2000)
$oFlash.SetVariable('_level0.userPaddle._height', 2000)
AdlibEnable('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibDisable()
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)
    
    $oFlash.SetVariable('_level0.enemyPaddle.VisPos', '')
    MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc

Change the necessary functions to make it to work.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Nope :) it wasn't a joke. It's cheap:

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

$oFlash.SetVariable('_level0.userPaddle._width', 2000)
$oFlash.SetVariable('_level0.userPaddle._height', 2000)
AdlibEnable('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibDisable()
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)
    
    $oFlash.SetVariable('_level0.enemyPaddle.VisPos', '')
    MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc

Change the necessary functions to make it to work.

Hmm.... Now When i changed some adlib stuff, it has no error, when i run it, it shows this:

C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3 (14) : ==> Only Object-type variables allowed in a "With" statement.:

With $oFlash

With ^ ERROR

Whats wrong??? Is there some errors?

Oh ya for AdLibEnable and Disable, i changed it to AdlibRegister, and UnRegister, But then I re-Syntax check and it said:

C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3(39,21) : ERROR: AdlibUnRegister() [built-in] called with wrong number of args.

AdlibUnRegister()

So then i changed AdlibUnRegister to: AdlibUnRegister("_TrackBallPos")

And then the errors gone. Is it suppose to be like this? ^^^^^^^^^^^^ Or is it just AdlibUnRegister().

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

3 Questions:

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

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

Number 1:

C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3(39,21) : ERROR: AdlibUnRegister() [built-in] called with wrong number of args.

AdlibUnRegister()

Do I Put it like this to fix the error? AdlibUnRegister("_TrackBallPos")

Or is it suppose to just be AdlibUnRegister()

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

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

Number 2:

C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3 (14) : ==> Only Object-type variables allowed in a "With" statement.:

With $oFlash

With ^ ERROR

What do i do here? And what does it mean by Object-Type variables? Do you know how to fix this?

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

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

Number 3:

Whats the Difference between ' and " ? I always see people putting ' instead of " .

And I only see a few people put " . I don't get it.... Help?

' = apostrophe

" = quotation mark

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

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

[optional] Please answer by doing this: [optional]

Number 1 answer:

Number 2 answer:

Number 3 answer:

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

Edited by zero57

[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

The AdlibUnRegister() expect a string representing the function to deregister but it wasn't so in AutoIt v3.3.0.0 so you should specify the function name to stop invoking. About the flash object, maybe you don't yet have flash 10 beta installed on your machine so it can't find this ProgId in the register. Try this instead with the rest of the script:

; ...
Dim $oFlash

; ...
$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") ; Should work

..the rest as it was, just change the adlib calls with how documented. Read the help file, it's all there.

Share this post


Link to post
Share on other sites

Well the pixel that seems to work the best for me is '0xEFFFE7' and if you - 45 from the X and + 18 to the Y it should make it center of the ball.. the best 'Way' for the bot to work is for it to 'Lead' the ball I.E. figure out if the bot is going Up, Down, Right, Left, Up Left, Down Left, Up Right, Down Right.. if the ball is going for example Up then make it so the 'Bot' leads up a bit.. make since..?


Latest Projects :- New & Improved TCP Chat

Share this post


Link to post
Share on other sites

The AdlibUnRegister() expect a string representing the function to deregister but it wasn't so in AutoIt v3.3.0.0 so you should specify the function name to stop invoking. About the flash object, maybe you don't yet have flash 10 beta installed on your machine so it can't find this ProgId in the register. Try this instead with the rest of the script:

; ...
Dim $oFlash

; ...
$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") ; Should work

..the rest as it was, just change the adlib calls with how documented. Read the help file, it's all there.

umm i have flash 10 beta....... And i tried the $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") But it didn't work... it still has the same error! :)

Well the pixel that seems to work the best for me is '0xEFFFE7' and if you - 45 from the X and + 18 to the Y it should make it center of the ball.. the best 'Way' for the bot to work is for it to 'Lead' the ball I.E. figure out if the bot is going Up, Down, Right, Left, Up Left, Down Left, Up Right, Down Right.. if the ball is going for example Up then make it so the 'Bot' leads up a bit.. make since..?

K got it. Now my script is a little bit better. Now my max level i got for now is level 4 :)

Of course, i couldn't have made it to level 4 using my bot without the help of the autoit forum people.

(autoit forum people..... quite long.... and kinda sounds weird....)


[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Can you test a little thing and post the results, if there are at all?

Dim $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
ConsoleWrite(@error & @TAB & ObjName($oFlash) & @LF)
Edited by Authenticity

Share this post


Link to post
Share on other sites

Can you test a little thing and post the results, if there are at all?

Dim $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
ConsoleWrite(@error & @TAB & ObjName($oFlash) & @LF)

Umm sure.... Here is the whole code i have from u that i edited.

HotKeySet('{ESC}', '_Close')
Opt('GUIOnEventMode', 1)

Dim $hGUI, $FlashCtrl
Dim $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
ConsoleWrite(@error & @TAB & ObjName($oFlash) & @LF)
Dim $fError

$oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash.10")
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
$hGUI = GUICreate('Test', 550, 400)
$FlashCtrl = GUICtrlCreateObj($oFlash, 0, 0, 550, 400)
GUISetOnEvent(-3, '_Close')

With $oFlash
    .Movie = "http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf"
    .Base = "http://www.albinoblacksheep.com/flash/curveball"
    .wmode = "opaque"
    .allowScriptAccess = "Always"
    .Playing = True
EndWith

GUISetState()


Do
    $fError = False
    $oFlash.GetVariable('_level0.enemyPaddle._width')
Until Not $fError

$oFlash.SetVariable('_level0.userPaddle._width', 2000)
$oFlash.SetVariable('_level0.userPaddle._height', 2000)
AdlibRegister('_TrackBallPos', 30)

While 1
    Sleep(10)
WEnd

Func _Close()
    AdlibUnRegister("_TrackBallPos")
    $oFlash.Stop()
    $oFlash = 0
    GUIDelete()
    Exit
EndFunc

Func _TrackBallPos()
    Local $aPos = WinGetPos($hGUI)

    $oFlash.SetVariable('_level0.enemyPaddle.VisPos', '')
    MouseClick('left', Random($aPos[0]+5, $aPos[0]+$aPos[2]-10, 1), Random($aPos[1]+30, $aPos[1]+$aPos[3]-30, 1), 1, 0)
    $fError = False
EndFunc

Func COMError()
    $fError = True
EndFunc

And here is the annoying error when i ran it:

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams    
+>20:49:27 Starting AutoIt3Wrapper v.2.0.0.1    Environment(Language:0409  Keyboard:00000409  OS:WIN_XP/Service Pack 2  CPU:X86 OS:X86)
>Running AU3Check (1.54.16.0)  from:C:\Program Files\AutoIt3\beta
+>20:49:27 AU3Check ended.rc:0
>Running:(3.3.1.1):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3"    
-2147221005 
C:\Documents and Settings\polam\Desktop\Authenticity-Test.au3 (15) : ==> Only Object-type variables allowed in a "With" statement.:
With $oFlash
With ^ ERROR
->20:49:27 AutoIT3.exe ended.rc:1
+>20:49:28 AutoIt3Wrapper Finished
>Exit code: 1    Time: 2.031

Any ideas?


[font="Arial Black"][u]zero57[/u][/font]

Share this post


Link to post
Share on other sites

What a mess :)

Seems like the object is not registered on your machine. Try to reinstall it from the Macromedia site, also tru #RequireAdmin directive.

Share this post


Link to post
Share on other sites

argh... I guess theres no way to fix it -.-

Oh well, anyways do u know any tips on making bots? I mean any kind of tips that can help me in the future days??


[font="Arial Black"][u]zero57[/u][/font]

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  
Followers 0