Sign in to follow this  
Followers 0
TnTProductions

Need help with bot script

16 posts in this topic

#1 ·  Posted (edited)

I decided i was going to make a basic bot for defend your castle(xgenstudios) i forgot one thing tho how to make the mouseclick() click on the pixel(man attacking you base) instead of defining cordinates just make it click on pixel search. Also i forgot how to make the script end when you hit esc.

HotKeySet("{esc}","quit"); <--------need help here

While 1

MouseClick("left",633,780)

$x = PixelSearch(428,390,680,597,0xcccccc)

If $x = True Then

MouseClickDrag("left",$x 0,$x 1,788,249); <------------ need help here

EndIf

WEnd

please post corrections!

thanks

Edited by TnTProductions

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites



This is a joke, right? :)

Open the helpfile and check the examples for HotKeySet() and PixelSearch(), everything is in there

woops i alwars forget about the help file :(


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

checked help file on pixelsearch() and nothing useful came up to shw me how to click on the pixel i searched for :)


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

PixelSearch returns an array with the coords in it.

$Coods=PixelSearch()..

$xpos=$Coods[0]

$ypos=$Coors[1]

MouseClick("Left", $xpos, $ypos)

Share this post


Link to post
Share on other sites

PixelSearch returns an array with the coords in it.

$Coods=PixelSearch()..

$xpos=$Coods[0]

$ypos=$Coors[1]

MouseClick("Left", $xpos, $ypos)

thanks

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

PixelSearch returns an array with the coords in it.

$Coods=PixelSearch()..

$xpos=$Coods[0]

$ypos=$Coors[1]

MouseClick("Left", $xpos, $ypos)

got an error saying:

$xpos = $cords[0]

......................^error

Error: Subsript used with nonarray variable

Edited by TnTProductions

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

i wish i could get some help like you are.

anyway...use this...

$C = PixelSearch()
If not @error then
MouseClick("left", $C[0], $C[1])
endif

that will work

Edited by d2addict4

Share this post


Link to post
Share on other sites

i wish i could get some help like you are.

anyway...use this...

$C = PixelSearch()
MouseClick("left", $C[0], $C[1])

that will work

thanks a bunch

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

#10 ·  Posted

i wish i could get some help like you are.

anyway...use this...

$C = PixelSearch()
If not @error then
MouseClick("left", $C[0], $C[1])
endif

that will work

i got the same error message wats wrong??!

$xpos = $cords[0]

......................^error

Error: Subsript used with nonarray variable


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

i wish i could get some help like you are.

anyway...use this...

$C = PixelSearch()
If not @error then
MouseClick("left", $C[0], $C[1])
endif

that will work

Ya'll want help? ... Starts with helping yourself first.

http://www.autoitscript.com/forum/index.php?showtopic=21048

http://www.autoitscript.com/forum/index.ph...c=19434&hl=

http://www.autoitscript.com/autoit3/docs/

http://www.autoitscript.com/autoit3/files/...t/undocumented/

Edit:

And if those don't help:

Try this first before posting: http://www.autoitscript.com/forum/index.php?act=Search

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

#12 ·  Posted

im using mouseclick drag() if that changes anything?

heres my script:

#cs ----------------------------------------------------------------------------

Script Version: 1.2

AutoIt Version: 3.2.10.0

Author: ÆTnTProductionsÆ

Script Function:

Fights Defend Your Castle for you on www.Xgenstudios.com

#ce ----------------------------------------------------------------------------

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

Func Terminate()

Exit 0

EndFunc

While 1

$cords = PixelSearch(478,390,585,469,0xcccccc)

If $cords = True Then

MouseClickDrag("left", $cords[0], $cords[1],842,258)

EndIf

WEnd


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

offtopic= smoken ive read the helpfile for the functions i need but its still not working. i have tried hard for at least a week and then posted here i still get no help

@topicstarter

try using if not @error not if $coors=true

Edited by d2addict4

Share this post


Link to post
Share on other sites

#14 ·  Posted

offtopic= smoken ive read the helpfile for the functions i need but its still not working. i have tried hard for at least a week and then posted here i still get no help

@topicstarter

try using if not @error not if $coors=true

you were right thanks!

ps:sorry your getting no help


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites

offtopic= smoken ive read the helpfile for the functions i need but its still not working. i have tried hard for at least a week and then posted here i still get no help

@topicstarter

try using if not @error not if $coors=true

The help file was one or two of 5 or 6 links I posted.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

The help file was one or two of 5 or 6 links I posted.

yes it was. and i have searched, and read the helpfile, it gives me examples but they use Sel() to select it. i dont know why my thread is getting now replies and nor is anyone helping me.

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