Sign in to follow this  
Followers 0
ColdDeath

Improving My Script

8 posts in this topic

Okay in previous posts I tried to use small pieces of my script. That didn't work, because it was to confusing for everyone.

So! I'll try to explain it as simple as possible about what the script does, and maybe you can try it. So you can give me tips about how to improve it.

The script is used on a TBMMORPG (aka Turn Based Massive Multiplayer Online Role Playing Game ) gc.gamestotal.com (Realtime Server).

Note: It's Turn based, so almost every action you do requires turns. Every 8 seconds you get a turn.

The goal of my script is to gain 850 land planets

Build Viator Ships => Explore => Found Planet

When planet has been found script will find out how much land the Planet has:

If it has 849 or less:

Manage Planets => Clicks on planet => Plunders it (plundering it = deleting it) After it the script will loop.

If it has 850 or more:

Script will loop and will find another planet

And what type of planet it is.

You can't plunder a X-planet, so I build aggresive ships so other players will attack me.

When aggresive ships have been build, he will research commercial. (the higher the level the more you will earn).

Here are the 3 scripts build for resolution: 1280 x 1024 Webbrowser Firefox

Explorer.au3

; C:\Users\Willie\Desktop\Scripts\Planet Script\Explorer.au3
Sleep ( 500 )

    WinActivate ( '(SFGC) Galactic Conquest - Mozilla Firefox' )
    WinWaitActive ( '(SFGC) Galactic Conquest - Mozilla Firefox' )

Sleep ( 2500 )

    MouseClick ( "left", 269, 415 )
Sleep ( 8000 ) ; Every sleep(8000), wil wait until the page has been loaded.


    MouseClick ( "left", 778, 395 )
        MouseClick ( "left", 778, 400 )
            MouseClick ( "left", 778, 405 )
                MouseClick ( "left", 778, 410 )
                    MouseClick ( "left", 778, 415 )
                        MouseClick ( "left", 778, 420 )
                            MouseClick ( "left", 778, 425 ) ; The button can shift verticly, so the mouse has been set to click in a verticle line.
Sleep ( 8000 )

    MouseClickDrag ( "left", 441, 321, 768, 321 ) ; Select text
Sleep ( 500 )
    Send ( " ^c " ) ; Copy the text
Sleep ( 500 )


    WinActivate ( 'Planet Checker' ); Activate the other script
    WinWaitActive ( 'Planet Checker' )
    send ( " ^v " ) ; Paste the text in the message box. The text is the amount of land.
    
Sleep ( 500 )
        Send ( "{BACKSPACE}" )
Sleep ( 50 )
            Send ( "{BACKSPACE}" )
Sleep ( 50 )
                Send ( "{LEFT 3}" )
Sleep ( 50 )
                    Send ( "{BACKSPACE 21}" )
Sleep ( 500 )
                        Send ( "{ENTER}" ) ; Edit the text so only numbers remain
                        
    WinActivate ( '(SFGC) Galactic Conquest - Mozilla Firefox' )
    WinWaitActive ( '(SFGC) Galactic Conquest - Mozilla Firefox' )
    

    MouseClickDrag ( "left", 436, 304, 768, 304 )
Sleep ( 500 )
    Send ( " ^c " )
Sleep ( 50 )


    WinActivate ( 'Planet Checker' )
    WinWaitActive ( 'Planet Checker' )
    Send ( " ^v " )
Sleep ( 500 )
        Send ( "{BACKSPACE 6}" )
Sleep ( 50 )
            Send ( "{BACKSPACE}" )
Sleep ( 50 )
            Send ( "{LEFT}" )
Sleep ( 50 )
                    Send ( "{BACKSPACE 21}" )
Sleep ( 500 )
                        Send ( "{ENTER}" ) ; Same deal, only then with the type of planet
Exit ; Exits, Explorer will take overoÝ÷ ØùZëBç$z¶®Ý«­¢+ØìèÀäÈíUÍÉÌÀäÈí]¥±±¥ÀäÈíͭѽÀÀäÈíMÉ¥ÁÑÌÀäÈíA±¹ÐMÉ¥ÁÐÀäÈíáÁ±½ÉȹÔÌ(ÀÌØí1½½ÀôÄ()]¡¥±ÀÌØí1½½ÀôÄ($(ÀÌØíÑáÐô%¹ÁÕÑ   ½à ÅÕ½ÐíA±¹Ð
¡­ÈÅÕ½Ðì°ÅÕ½Ðí%¹ÁÕб¹Ù±ÕÅÕ½Ðì¤($(%ÀÌØíÑáбÐìÅÕ½ÐìàÔÀÅÕ½ÐìQ¡¸ìMÉ¥ÁÐÝ¥±°Ý¥Ðչѥ°áÁ±½ÉÈ¥±±Ì¥¸Ñ¡Ñáи($$$$($$$ÀÌØíÑáÐô%¹ÁÕÑ ½à ÅÕ½ÐíA±¹Ð
¡­ÈÅÕ½Ðì°ÅÕ½Ðí%¹ÁÕÐA±¹Ð9µÅÕ½Ðì¤ìA±¹Ð½Í¸ÌäíСٹ½Õ ±¹°Í¼¥ÐÝ¥±°¥¹½ÕÐݡЭ¥¹½Á±¹Ð¥Ð¥Ì¸($$$$($$$%%ÀÌØíÑáбÐìÐìÅÕ½Ðí`ÅÕ½ÐìQ¡¸ì]¥±°Á±Õ¹ÈÑ¡Á±¹Ð¸($$$$%5½ÕÍ
±¥¬$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÈàÜ°ÌÌÀ¤($$$$%M±À$$ àÀÀÀ¤($$$$%5½ÕÍ
±¥¬$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÐÈÌ°ÌÈÔ¤($$$$%M±À$$ àÀÀÀ¤($$$$%5½ÕÍ
±¥¬$ ÅÕ½Ðí±ÐÅÕ½Ðì°ÜàаÐÈÀ¤($$$$%M±À$$ àÀÀÀ¤($$$$%5½ÕÍ
±¥¬$ ÅÕ½Ðí±ÐÅÕ½Ðì°ØÈаÔÀ̤($$$$%M¡±±áÕÑ ÅÕ½ÐíèÀäÈíUÍÉÌÀäÈí]¥±±¥ÀäÈíͭѽÀÀäÈíMÉ¥ÁÑÌÀäÈíA±¹ÐMÉ¥ÁÐÀäÈíáÁ±½ÉȹÔÌÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíIÕ¸ÅÕ½Ðì¤ì1½½ÁÌÑ¡ÍÉ¥ÁÐ¥¸($$$%±Í($$$$%M¡±±áÕÑ ÅÕ½ÐíèÀäÈíUÍÉÌÀäÈí]¥±±¥ÀäÈíͭѽÀÀäÈíMÉ¥ÁÑÌÀäÈíA±¹ÐMÉ¥ÁÐÀäÈí`µÁ±¹Ð¹ÔÌÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíIÕ¸ÅÕ½Ðì¤ìáÕÑÌ`µÁ±¹Ð¹Ô̸($$$%¹%($%±Í($$%M¡±±áÕÑ ÅÕ½ÐíèÀäÈíUÍÉÌÀäÈí]¥±±¥ÀäÈíͭѽÀÀäÈíMÉ¥ÁÑÌÀäÈíA±¹ÐMÉ¥ÁÐÀäÈíáÁ±½ÉȹÔÌÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíIÕ¸ÅÕ½Ðì¤($%¹%)]¹oÝ÷ Ùzejw­jíÚºÚ"µÍÈÎÌLÕÙÉÌLÕÚ[YIÌLÑÚÝÜ ÌLÔØÜÉÌLÔ[]ØÜ  ÌLÖ[]]LÂÚ[XÝ]]HJ   ÌÎNÊÑÐÊHØ[XÝXÈÛÛ]YÝH[Þ[HYÞ    ÌÎNÈ
BÚ[ØZ]XÝ]HJ  ÌÎNÊÑÐÊHØ[XÝXÈÛÛ]YÝH[Þ[HYÞ    ÌÎNÈ
B[ÝÙPÛXÚÈBJ    ][ÝÓY ][ÝËK
M
HÈ^ÜBÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÓY ][ÝË
ÍÍË
MÈ
HÈ[È[]ÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÓY ][ÝËK
M
HÈ^ÜÈYØZ[ÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÓY ][ÝË
ÍÍË
MÈ
HÈ[È[Ý[]ÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝËÍ

HÈÛÙÈÈZ[ÚÂÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝË

H
HÈÙ[XÝÈHÚÂÛYBBJ
BÙ[BBJ ][ÝÌI][ÝÈ
HÛYBBJ
L
BÙ[BBJ ][ÝÞÑ[I][ÝÈ
HÈZ[ÈHÚ[ÛHÚÛYBBJ
B[ÝÙPÛXÚÂBJ    ][ÝÛY ][ÝËÍ
Ì
HÈÛÙÈÈÙXÚÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝË
KÌLH
HÈÙ[XÝÈÛÛ[YÚX[ÛYBBJ
B[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝË
ÎK
N
HÈÝÈHÙXÚ[ÛÙÈ[HÛÜÛYBBJ
BÚ[H   ÌÍØÛÜHBÚ[XÝ]]HJ  ÌÎNÊÑÐÊHØ[XÝXÈÛÛ]YÝH[Þ[HYÞ    ÌÎNÈ
BUÚ[ØZ]XÝ]HJ ÌÎNÊÑÐÊHØ[XÝXÈÛÛ]YÝH[Þ[HYÞ    ÌÎNÈ
BS[ÝÙPÛXÚÈBJ   ][ÝÛY ][ÝË
N


BBS[ÝÙPÛXÚÈBJ  ][ÝÛY ][ÝË
N

H
BBBS[ÝÙPÛXÚÈBJ ][ÝÛY ][ÝË
N

Ì
BBBBS[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝË
N

ÍH
BBBBBS[ÝÙPÛXÚÈBJ   ][ÝÛY ][ÝË
N

BBBBBBS[ÝÙPÛXÚÈBJ  ][ÝÛY ][ÝË
N

H
BBBBBBBS[ÝÙPÛXÚÈBJ ][ÝÛY ][ÝË
N
L
BBBBBBBBS[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝË
N
MH
BBBBBBBBBS[ÝÙPÛXÚÈBJ   ][ÝÛY ][ÝË
N
L
H
BBBBBBBBBBS[ÝÙPÛXÚÈBJ  ][ÝÛY ][ÝË
N
LMH
BBBBBBBBBBBS[ÝÙPÛXÚÈBJ ][ÝÛY ][ÝË
N
LH
BBBBBBBBBBBBS[ÝÙPÛXÚÈBJ    ][ÝÛY ][ÝË
N
LÍH
BBBBBBBBBBBBBS[ÝÙPÛXÚÈBJ   ][ÝÛY ][ÝË
N
M
H
BBBBBBBBBBBBBBS[ÝÙPÛXÚÈBJ  ][ÝÛY ][ÝË
N
MMH
HÈ]ÛØ[ÚYXÛKÛÈH[ÝÙHÚ[[ÝHXÛBBTÛY

HÈØZ]È[[[ÝYÚÈØ[HÙYBRYÚ[XÝ]]H
    ][ÝÓ[Þ[HYÞ  ][ÝÈ
HLH[ÈÚ[]XÚÙY[ÝIÌÎNÛÙ]HØ[ÈÚ[ÝËÛÈYÛÌÎNÝKHÙXÚÚ[ÛÛ[YKY]ËÙXÚÜ[]ÈYØZ[ÌÌÎÂBBUÚ[XÝ]]HJ ÌÎNÊÑÐÊHØ[XÝXÈÛÛ]YÝH[Þ[HYÞ    ÌÎNÈ
BBBUÚ[ØZ]XÝ]HJ   ÌÎNÊÑÐÊHØ[XÝXÈÛÛ]YÝH[Þ[HYÞ    ÌÎNÈ
BBBS[ÝÙPÛXÚÈBJ ][ÝÛY ][ÝËÍ

HÈÛÙÈÈZ[ÚÂBBTÛYBBJ
BBBS[ÝÙPÛXÚÈBJ ][ÝÛY ][ÝË
Ì
L
HÈÙ[XÝÈX]ÜÚÂBBTÛYBBJ
BBBTÙ[BBJ  ][ÝÍ  ][ÝÈ
BBBTÙ[BBJ  ][ÝÞÑ[I][ÝÈ
HÈÚ[Z[
ÚËBBTÚ[^XÝ]BJ   ][ÝÐÎÌLÑØÝ[Y[È[Ù][ÜÉÌLÔÙ[ÙÉÌLÐX]XY    ÌLÔØÜÉÌLÑ^Ü]LÉ][ÝË   ][ÝÉ][ÝË    ][ÝÉ][ÝË    ][ÝÔ[][ÝÊHÈ[È^ÜYØZ[BBQ^]ÛÜBQ[YUÑ[^]

The problems

- Sometimes waiting for 8 seconds for a page to load, isn't enough. Result: I miss a whole loop.

- I have to run 3 scripts (I just want to run one)

- Mouseclick coordinates takes a lot of time.

- I know it's really primitive...

- It only works on one screensize

- AutoIt doesn't support Mozilla Firefox

- etc, etc, etc

So my question is: Because I'm a real newbie, and this is as advance as I can get.

If you have time, could you improve my script, please?

Thanks in advance,

ColdDeath

Share this post


Link to post
Share on other sites



I didn't look closely but why not use functions? There is also an FF.au3 script that allows some FF automation. You could also use ControlClick() instead of MouseClick() and a few other functions in the FF.au3 to make it work with all screensizes.

Share this post


Link to post
Share on other sites

I didn't look closely but why not use functions? There is also an FF.au3 script that allows some FF automation. You could also use ControlClick() instead of MouseClick() and a few other functions in the FF.au3 to make it work with all screensizes.

As I said, I'm just a newbie, I don't know how the FF.au3 works, so some explaining would be thankfull.

ControlClick? Like same as MouseClick, but no visable mouse? (hmmm... should look cool though!)

Share this post


Link to post
Share on other sites

Well if you DL the FF.au3 and read through the code you might start to understand. Also ControlClick() doesn't use your mouse,it simulates moving the mouse and clicking. It's easier than you think once you understand how it works. Do you understand what I mean about consolidating your scripts into functions?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Well if you DL the FF.au3 and read through the code you might start to understand.

Reading through FF.au3... that's a REALLY big chunck to read through...

Also ControlClick() doesn't use your mouse,it simulates moving the mouse and clicking.

Mouseclick also simulates the mouse movements...

Do you understand what I mean about consolidating your scripts into functions?

Sorry, my english vocabulary isn't that extended jet.

Edited by ColdDeath

Share this post


Link to post
Share on other sites

your game is in webbrowser like firefox ?

if it's right it's better to use IE because you have lot of functions for ctrl read etc...


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

your game is in webbrowser like firefox ?

if it's right it's better to use IE because you have lot of functions for ctrl read etc...

Good idea, I'll go to IE!

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