Shaiya bot
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Shaiya bot
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.
-
- Posts: 148
- Joined: Fri Mar 21, 2008 9:10 pm
Re: Shaiya bot
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
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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Shaiya bot
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.
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Re: Shaiya bot
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
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
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Shaiya bot
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.
-
- Posts: 8
- Joined: Thu May 08, 2008 10:21 pm
Re: Shaiya bot
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.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Shaiya bot
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.
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
Just chiming in here to say that this is totally cool
Re: Shaiya bot
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!
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: is this ZS bot suite for micromacro 0.96?
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
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
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?
\Desktop\micromacro\scripts\shaiya.lua:29: attempt to call global 'secondsToTimer' <a nil value>
any ideas?
- 3cmSailorfuku
- Posts: 354
- Joined: Mon Jan 21, 2008 6:25 pm
Re: Shaiya bot
Look if the Shaiya DLLs have exports, you can use them with micromacro thenShaunO 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..
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Shaiya bot
Download a newer version. secondsToTimer() has been added to the lib in the official release of 0.97.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?
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.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..
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
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?
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: Shaiya bot
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
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 ?
-
- Posts: 59
- Joined: Tue May 20, 2008 5:45 am
Re: Shaiya bot
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.
assuming that the target's hp is full and no one is hitting it so that would prevent ksing.
Re: Shaiya bot
i get what u mean..but dont know how to do itdeaznracer 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.
Who is online
Users browsing this forum: No registered users and 1 guest