Page 11 of 22

Re: Shaiya bot

Posted: Sat Apr 19, 2008 6:40 pm
by Administrator
vvayinsane: It looks like the probably cause was that the handle was improperly closed/modified, or that Shaiya decided to change it's pointers randomly. About the only thing you can do at this point is just to close both MicroMacro and Shaiya, then reopen the game and try again. Either that, or, I suppose, HP2_potion_use could have been assigned nil... But I don't see anything in your code that would do that after executing 11,000+ times.

Re: Shaiya bot

Posted: Sun Apr 20, 2008 4:32 am
by vvayinsane
I fixed the bot. My script works now.
I had to change this line
if( (HP/MaxHP*100) < HP1_potion_use and HP1_potion_use > 0 ) then use_hp1_potion(); end
if( (HP/MaxHP*100) < HP2_potion_use and HP2_potion_use > 0 ) then use_hp2_potion(); end
to
if( (HP/MaxHP*100) < HP1_potion_use and HP1_potion_use > 0 ) then use_hp_potion(); end
if( (HP/MaxHP*100) < HP2_potion_use and HP2_potion_use > 0 ) then use_hp_potion(); end

for some reason that fixed the problem

Re: Shaiya bot

Posted: Sun Apr 20, 2008 10:34 am
by Administrator
I'm not really sure I understand why it threw that error if changing it like that fixed the error. It doesn't look like there is anything in the functions that you have added that could generate the type of error. Keep playing with it and I'm sure you'll figure it out.

Re: Shaiya bot

Posted: Thu May 08, 2008 10:29 pm
by FlyingCircus
I have the current script and changed according to my hotkeys and I get this error
MicroMacro v0.97
SolarImpact
http://solarimpact.servegame.com


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script> zs_shaiya/shaiya2.lua
Opening zs_shaiya/shaiya2.lua...

Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------
The macro is currently not running. Press the start key (F5) to begin.
You may use (F6) key to stop/pause the script.
Started.
...son\Desktop\micromacro\scripts\zs_shaiya/shaiya2.lua:166: bad argument #1 to
'memoryReadIntPtr' ((null))


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>


What do I need to do? And yes I think I still have GG running

Re: Shaiya bot

Posted: Thu May 08, 2008 11:15 pm
by Administrator
If you have GameGuard running, then there's your problem. Go back to page 1 and download the no GG patch. Without it, MicroMacro cannot obtain a proper handle to the game, which means that the handle passed to memoryRead* functions will be nil, resulting in an error.

Re: Shaiya bot

Posted: Fri May 09, 2008 9:56 am
by FlyingCircus
Thanks, It works perfectly now. I did adjust the HP % to rest better and use less pots. You guys rock! I can't imagine how hard you worked on this. by the way since you're the expert where is a good place to start learning how to script well. I have only taken a Programming logic class and I wanna experiment.

Re: Shaiya bot

Posted: Fri May 09, 2008 5:40 pm
by Administrator
Well, there is no place to learn to script well. It's just something you pick up from experience as you learn from your mistakes. Just make sure you follow the typical "rules" of programming, such as proper indentation (either spaces or tabs, you will see I prefer spaces), consistent naming conventions (ie. all MicroMacro functions are camel-case, starting with a lower case letter, and contain no underscores), and documenting and commenting your code when necessary.

You can join the Allegro programming community if you would like. It is mostly geared towards C/C++ programming using the Allegro library, but you can ask questions on just about anything. If you just want to learn more Lua, you should just pick a game and write a simple script for it. Free Game List.

Play the game for a little while till you figure out the general feel of it. Hopefully you've picked a game that uses hotkeys to target and attack an enemy (this makes things MUCH easier). Then, begin by writing your main loop, and cycle between targeting and attacking a monster. Once you've got that setup, you will begin coding a small function that checks if you even have a monster targeted. You can do this by checking a memory address, or by reading the screen's image to check for a monster's nameplate at a specific location. Once you've got it working, make your attack function contain a while loop that will continue attacking the monster (possibly using skills) while you have it targeted.

If you have any other questions on this mater, open a new thread. It doesn't fit the description of the Shaiya bot.

Re: Shaiya bot

Posted: Sun May 18, 2008 1:05 am
by ShaunO
Just chiming in here to say that this is totally cool :D

Re: Shaiya bot

Posted: Tue May 20, 2008 8:46 am
by ShaunO
Spent ages trying to find the real pointer for monster HP, easy enough to get the current location in memory but it changes for every target, anyone know a static pointer to use? Very keen to use monster HP, cheers!

Re: Shaiya bot

Posted: Tue May 20, 2008 1:53 pm
by Administrator

Re: is this ZS bot suite for micromacro 0.96?

Posted: Wed May 21, 2008 2:02 am
by bewok
i tried with 0.97 it say cant open the script or where do i need to extract this Zs bot are they onto micronacro foleder...sry for this,..im newb thx

Re: Shaiya bot

Posted: Wed May 21, 2008 3:06 am
by ShaunO
Cheers, I went through a lot pointers before it stopped working, I guess I have to keep trying.

Is it even possible to get a static pointer for mob HP?

Need to get a DLL injected or something so we can hook into the game and actually do some fun stuff, mainly with macroing but that'd be a pretty big project I think..

Re: Shaiya bot

Posted: Wed May 21, 2008 3:24 am
by Enthalpy
Have a problem starting the bot get this error in micro macro
\Desktop\micromacro\scripts\shaiya.lua:29: attempt to call global 'secondsToTimer' <a nil value>

any ideas?

Re: Shaiya bot

Posted: Wed May 21, 2008 5:19 am
by 3cmSailorfuku
ShaunO wrote:
elverion wrote: Need to get a DLL injected or something so we can hook into the game and actually do some fun stuff, mainly with macroing but that'd be a pretty big project I think..
Look if the Shaiya DLLs have exports, you can use them with micromacro then ;)

Re: Shaiya bot

Posted: Wed May 21, 2008 8:13 am
by Administrator
Enthalpy wrote:Have a problem starting the bot get this error in micro macro
\Desktop\micromacro\scripts\shaiya.lua:29: attempt to call global 'secondsToTimer' <a nil value>

any ideas?
Download a newer version. secondsToTimer() has been added to the lib in the official release of 0.97.

Is it even possible to get a static pointer for mob HP?

Need to get a DLL injected or something so we can hook into the game and actually do some fun stuff, mainly with macroing but that'd be a pretty big project I think..
Is it possible? I'm sure it is. But I didn't find one. I also wasn't using Cheat Engine for that, which is much more useful to find pointers to pointers, which is probably how it would be stored. That is, your player class would hold the address of the monster class you have targeted, which would then hold pointers to it's HP among other stats. Follow along the Cheat Engine tutorial on looking up pointers, and be prepared to repeat the process a few times.

As already stated, DLL injection is possible with MicroMacro. Injection is done through a plugin, so you would need to download the injector plugin, which can be found in the plugins section of this forum.

Re: Shaiya bot

Posted: Wed May 28, 2008 9:07 pm
by Enthalpy
Thanks bot is working great. Works very well with melee characters but not so much with priest or mage. I had another question about sitting/standing. the bot seems to sit and then stand right away and i have tried to place 0's on the mp and sp but the player will still stand and sit instead of just sitting till percentage that is set. any ideas?

Re: Shaiya bot

Posted: Wed May 28, 2008 10:17 pm
by Administrator
Can you say that again? Do you mean he/she will continue to sit and stand until their MP/SP is full? Or do you mean they sit, stand, and then fighting right away? Please be as precise as possible.

Re: Shaiya bot

Posted: Thu May 29, 2008 2:22 am
by centik
i wonder is there such a scripts when ur character get stuck or trying to get to a mob and and a tree or rock is in his way and cant reach the montser he'll turn back and look for another monster ?

Re: Shaiya bot

Posted: Thu May 29, 2008 2:32 am
by deaznracer
what i did was made a function that at a certain amount of time if the hp has not dropped it will return true. and if true i scan for another target.

assuming that the target's hp is full and no one is hitting it so that would prevent ksing.

Re: Shaiya bot

Posted: Thu May 29, 2008 2:55 am
by centik
deaznracer wrote:what i did was made a function that at a certain amount of time if the hp has not dropped it will return true. and if true i scan for another target.

assuming that the target's hp is full and no one is hitting it so that would prevent ksing.
i get what u mean..but dont know how to do it :?