Learning AutoIt

03/11/2020 19:30 ThomasGBL#1
Hello,

I am learning coding, I just started with AutoIt to create simple scripts and I'd like to understand a very used Nostale bot made with Autoit ([Only registered and activated users can see links. Click Here To Register...])

It only has several lines that I tried to copy in my own AutoIt file that you can find below and then execute it but it doesn't work, it says there is an error. I probably made some mistakes can you guys take a look at it and tell me what do I have to do to make it work ? It's probably so basic to y'all who use C++ but well I need to start somewhere :D

Code:
Func Départ ()
   WinActivate("NosTale","")
   AutoItSetOption ("PixelCoordMode",2)
Sleep(500)
while 1
   $agresse = 0
   If PixelGetColor(170,28) = 0x6B6C6C Then
	  ToolTip("En combat [Vie < 45%]",0,0)
	  $var = 0
	  While $var < 15
		 $var = $var  1
		 VerifVie()
		 Ramasse()
		 Combat()
	  WEnd
	  Repos()
   Else
	  ToolTip("Nostale en combat",0,0)
	  VerifVie()
	  Ramasse()
	  SelectMob()
	  Combat
   EndIf
WEnd
   EndFunc
03/11/2020 19:43 EPvPAgen#2
Quote:
Originally Posted by ThomasGBL View Post
Hello,

I am learning coding, I just started with AutoIt to create simple scripts and I'd like to understand a very used Nostale bot made with Autoit ([Only registered and activated users can see links. Click Here To Register...])

It only has several lines that I tried to copy in my own AutoIt file that you can find below and then execute it but it doesn't work, it says there is an error. I probably made some mistakes can you guys take a look at it and tell me what do I have to do to make it work ? It's probably so basic to y'all who use C++ but well I need to start somewhere :D

Code:
Func Départ ()
   WinActivate("NosTale","")
   AutoItSetOption ("PixelCoordMode",2)
Sleep(500)
while 1
   $agresse = 0
   If PixelGetColor(170,28) = 0x6B6C6C Then
	  ToolTip("En combat [Vie < 45%]",0,0)
	  $var = 0
	  While $var < 15
		 $var = $var  1
		 VerifVie()
		 Ramasse()
		 Combat()
	  WEnd
	  Repos()
   Else
	  ToolTip("Nostale en combat",0,0)
	  VerifVie()
	  Ramasse()
	  SelectMob()
	  Combat
   EndIf
WEnd
   EndFunc
I never did something with Autoit, but there are functions you never defined (?)
You should better write the code by yourself
03/11/2020 19:48 ThomasGBL#3
I really Don't know much that's the first time I code Something but I watched many videos and read many articles before starting, maybe I should directly create it in C++ ?

Quote:
I never did something with Autoit, but there are functions you never defined (?) You should better write the code by yourself ]
I just copied/pasted the code and tried to understand it but indeed I could see that things were missing but the problem is I don't know how to resolve it by myself yet
03/11/2020 20:03 EPvPAgen#4
Quote:
Originally Posted by ThomasGBL View Post
I really Don't know much that's the first time I code Something but I watched many videos and read many articles before starting, maybe I should directly create it in C++ ?



I just copied/pasted the code and tried to understand it but indeed I could see that things were missing but the problem is I don't know how to resolve it by myself yet
To solve your errors you have to write the functions, and they are the core part of the bot - i'm not quite sure why this page "released" that snippet of code

You could directly create it in C++ sure, but you better first learn the basics before creating a bot