Shaiya bot

For any other game that doesn't have its own section.
Message
Author
User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Shaiya bot

#201 Post by Administrator » Sat Apr 19, 2008 6:40 pm

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.

vvayinsane
Posts: 148
Joined: Fri Mar 21, 2008 9:10 pm

Re: Shaiya bot

#202 Post by vvayinsane » Sun Apr 20, 2008 4:32 am

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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Shaiya bot

#203 Post by Administrator » Sun Apr 20, 2008 10:34 am

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.

FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Re: Shaiya bot

#204 Post by FlyingCircus » Thu May 08, 2008 10:29 pm

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

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Shaiya bot

#205 Post by Administrator » Thu May 08, 2008 11:15 pm

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.

FlyingCircus
Posts: 8
Joined: Thu May 08, 2008 10:21 pm

Re: Shaiya bot

#206 Post by FlyingCircus » Fri May 09, 2008 9:56 am

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.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Shaiya bot

#207 Post by Administrator » Fri May 09, 2008 5:40 pm

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.

ShaunO
Posts: 3
Joined: Sun May 18, 2008 1:04 am

Re: Shaiya bot

#208 Post by ShaunO » Sun May 18, 2008 1:05 am

Just chiming in here to say that this is totally cool :D

ShaunO
Posts: 3
Joined: Sun May 18, 2008 1:04 am

Re: Shaiya bot

#209 Post by ShaunO » Tue May 20, 2008 8:46 am

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!


bewok
Posts: 2
Joined: Mon May 19, 2008 2:32 am

Re: is this ZS bot suite for micromacro 0.96?

#211 Post by bewok » Wed May 21, 2008 2:02 am

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

ShaunO
Posts: 3
Joined: Sun May 18, 2008 1:04 am

Re: Shaiya bot

#212 Post by ShaunO » Wed May 21, 2008 3:06 am

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..

Enthalpy
Posts: 2
Joined: Wed May 21, 2008 3:21 am

Re: Shaiya bot

#213 Post by Enthalpy » Wed May 21, 2008 3:24 am

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?

User avatar
3cmSailorfuku
Posts: 354
Joined: Mon Jan 21, 2008 6:25 pm

Re: Shaiya bot

#214 Post by 3cmSailorfuku » Wed May 21, 2008 5:19 am

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 ;)

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Shaiya bot

#215 Post by Administrator » Wed May 21, 2008 8:13 am

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.

Enthalpy
Posts: 2
Joined: Wed May 21, 2008 3:21 am

Re: Shaiya bot

#216 Post by Enthalpy » Wed May 28, 2008 9:07 pm

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?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Shaiya bot

#217 Post by Administrator » Wed May 28, 2008 10:17 pm

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.

centik
Posts: 51
Joined: Sat Apr 19, 2008 2:03 am

Re: Shaiya bot

#218 Post by centik » Thu May 29, 2008 2:22 am

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 ?

deaznracer
Posts: 59
Joined: Tue May 20, 2008 5:45 am

Re: Shaiya bot

#219 Post by deaznracer » Thu May 29, 2008 2:32 am

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.

centik
Posts: 51
Joined: Sat Apr 19, 2008 2:03 am

Re: Shaiya bot

#220 Post by centik » Thu May 29, 2008 2:55 am

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 :?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest