Shaiya bot

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

Shaiya bot

#1 Post by Administrator » Thu Jan 17, 2008 1:18 am

Instructions:
Step 1: Install no GameGuard patch.
  • If you haven't already, run the auto patcher and let Shaiya update to the latest version. Then download and extract the 4 files contained in the attached patch (shaiya.no.gg.patch.zip) into the Shaiya folder (C:/AeriaGames/Shaiya/ by default). Double click on the file named Apply.GG.patch and a black window should pop up telling you there were a few changes made. Close this window then start Shaiya normaly.

    If the window says something about a CRC mismatch, then you probably have either a different client version than what this patch supports (please let me know if this is the case), or you have a modified client.

    *GameGuard will still load, but is deactivated.
Step 3: Download attached shaiya.lua, and save it into MicroMacro's scripts folder. Modify shaiya.lua to fit your character. You must edit the HOTKEYS section (near the top) to be the same as the hotkeys you use in-game.

Step 4: Open Shaiya and log in.

Step 5: Open micromacro.exe, type in "shaiya.lua" (without quotes), press enter.

Step 6: Go back to Shaiya, and press INSERT to start botting.


It doesn't work too well with any mage class (as they aren't very good at soloing).
Attachments
Shaiya.no.gg.mc.patch.zip
Updated: Aug. 25, 2009
(12.67 KiB) Downloaded 1049 times
shaiya.lua
Updated: Aug 7, 2009
License: non-restricted, public domain.
(13.65 KiB) Downloaded 1108 times

Guest

Re: Shaiya bot

#2 Post by Guest » Sun Jan 20, 2008 10:52 am

greetings.


I am about to dig into this game. I hope the site becomes a good info source!

nice work so far

Reiiko

Re: Shaiya bot

#3 Post by Reiiko » Thu Jan 24, 2008 10:35 am

What do i need to open and configure or something :P

Reiiko

#4 Post by Reiiko » Thu Jan 24, 2008 10:39 am

it says: I need to open a Script what is the script i'm a newb to this..

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

Re: Shaiya bot

#5 Post by Administrator » Thu Jan 24, 2008 12:08 pm

shaiya.lua is the script. You configure the variables to fit your needs, then save it in the micromacro/scripts folder. You can also just right-click shaiya.lua -> Open With -> Browse, and find micromacro.exe (this works if shaiya.lua is outside MicroMacro's script folder -- but you won't be able to reload the script without closing MicroMacro and redoing this process).

If you haven't found a bypass for GameGuard, then it's all going to be useless, as the bot won't do anything.

Reiiko

Re: Shaiya bot

#6 Post by Reiiko » Thu Jan 24, 2008 12:12 pm

Thank you

Reiiko

Re: Shaiya bot

#7 Post by Reiiko » Thu Jan 24, 2008 12:13 pm

But i dont know what to edit :(

Code: Select all

-------------------------------------------------
-- Variable declaration -- do not edit
-------------------------------------------------
CLASS_WARRIOR   = 0;
CLASS_MAGE      = 1;
HP              = 10000;
HPmax           = HP;
MP              = 10000;
MPmax           = MP;
SP              = 10000;
SPmax           = SP;

HP_ptr         = "020F2910";
HP_offset      = 296;
HPmax_ptr      = "020F2910";
HPmax_offset   = 300;

MP_ptr         = "020F2910";
MP_offset      = 304;
MPmax_ptr      = "020F2910";
MPmax_offset   = 308;

SP_ptr         = "020F2910";
SP_offset      = 312;
SPmax_ptr      = "020F2910";
SPmax_offset   = 316;

-------------------------------------------------


-------------------------------------------------
-- character configuration
-------------------------------------------------
class           = CLASS_DEFENDER;
key_attack      = key.VK_1;
key_pickup      = key.VK_2;
key_sit         = key.VK_C;

key_skill1      = key.VK_3;
key_skill2      = key.VK_4;
key_skill3      = key.VK_5;

key_hppotion    = key.VK_8;
key_mppotion    = key.VK_9;
key_sppotion    = key.VK_9;

-- rest or use potions when low on HP/MP/SP
HP_usepotion    = 350;
MP_usepotion    = 0;
SP_usepotion    = 0;

HP_sit          = 180;
MP_sit          = 0;
SP_sit          = 20;

-- chance to cast
skill1_chance   = 100;
skill2_chance   = 0;
skill3_chance   = 0;

-- MP cost
skill1_cost     = 38;
skill2_cost     = 20;
skill3_cost     = 80;

casttime        = 2000;
-------------------------------------------------

function use_hppotion(2)
  keyboardPress(key_hppotion);
end

function use_mppotion(3)
  keyboardPress(key_mppotion);
end

function use_sppotion(2)
  keyboardPress(key_sppotion);
end

-- so we aren't spamming the attack key...
-- we will use a timer to press it once
-- every 3 seconds.
function attack_timer(3000)
  keyboardPress(key_attack);
end

function fight_warrior(2)
  registerTimer("attack_timer", 3000, attack_timer);

  while( have_target() ) do
    if( HP < HP_usepotion ) then
      use_hppotion(); end
    if( MP < MP_usepotion ) then
      use_mppotion(); end
    if( SP < SP_usepotion ) then
      use_sppotion(); end

    yrest(100);
    coroutine.yield();
  end

  unregisterTimer("attack_timer");

  yrest(1000);
  pickup(5);
end

function fight_mage()
  while( have_target() ) do
    if( HP < HP_usepotion ) then
      use_hppotion(); end
    if( MP < MP_usepotion ) then
      use_mppotion(); end
    if( SP < SP_usepotion ) then
      use_sppotion(); end

    local roll = math.random(100);
    if( roll <= skill1_chance and MP >= skill1_cost ) then
      -- cast skill 1
      keyboardPress(key_skill1);
      yrest(casttime);
    else
      keyboardPress(key_attack);
    end

    yrest(100);
    coroutine.yield();
  end

  yrest(1000);
  pickup(5);
end

-- heal until full HP & MP
function rest_heal(6)

  local last_HP = HP;

  keyboardPress(key_sit);
  yrest(100);
    while( HP < HPmax ) do
      if( HP < last_HP ) then
        print("Under attack! Exiting rest");
        return;
      else
        last_HP = HP;
      end

      yrest(100);
      coroutine.yield();
    end
  keyboardPress(key_sit);
  yrest(1000);
end

-- pickup nearby items
function pickup(5)
  for i = 1,5 do
    keyboardPress(key_pickup);
    yrest(500);
  end
end

-- update client variables by reading from it's memory
function update_vars()
  HP = memoryReadIntPtr(proc, HP_ptr, HP_offset);
  HPmax = memoryReadIntPtr(proc, HPmax_ptr, HPmax_offset);

  MP = memoryReadIntPtr(proc, MP_ptr, MP_offset);
  MPmax = memoryReadIntPtr(proc, MPmax_ptr, MPmax_offset);

  SP = memoryReadIntPtr(proc, SP_ptr, SP_offset);
  SPmax = memoryReadIntPtr(proc, SPmax_ptr, SPmax_offset);
end

function have_target()
  --1280*1024
  --  X: 345, Y: 36
  --  16bit: 165, 24, 66
  --  32bit: 163, 25, 65
  --1024*768
  --  X: 258, Y: 36
  --  16bit: 165, 28, 66
  --  32bit: 165, 30, 68

  local r,g,b;

  -- use the window's rect to find the resolution
  local wx,wy,ww,wh = windowRect(win);

  if( ww == 1024 and wh == 768 ) then
    r,g,b = getPixel(win, 258, 36);
  elseif( ww == 1280 and wh == 1024 ) then
    r,g,b = getPixel(win, 345, 36);
  else
    r,g,b = 0;
    print("Unsupported resolution! Please use 1024*768 or 1280*1024.");
  end

  --printf("R: %d, G: %d, B: %d\n", r, g, b);

  -- if there is still HP left in monster's HP bar...return true
  if( r >= 160 and r <= 170 and g >= 20 and g <= 34 and b >= 63 and b <= 73) then
    return true;
  else
    return false;
  end
end


-------------------------------------------------
-- FUNCTION MAIN
-------------------------------------------------
function main()
  proc = openProcess( findProcess("Shaiya") );
  win = findWindow("Shaiya");
  attach(win);

  registerTimer("update_vars", 100, update_vars);

  running = true;
  while( running ) do
    if( keyPressed(key.VK_F7) == 1 ) then
      running = false; end

    keyboardPress(key_attack);

    if( have_target() ) then
      if( class == CLASS_WARRIOR ) then
        fight_warrior();
      elseif( class == CLASS_MAGE ) then
        fight_mage();
      end
    end

    yrest(500);

    if( HP < HP_sit or MP < MP_sit or SP < SP_sit ) then
      rest_heal(); end

    yrest(200);
  end

  closeProcess(proc);
  detach();
end

startMacro(main);
-------------------------------------------------
I dont get this whole thing

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

Re: Shaiya bot

#8 Post by Administrator » Thu Jan 24, 2008 3:35 pm

class = CLASS_DEFENDER;
That's wrong. There are only two choices: CLASS_WARRIOR, or CLASS_MAGE. You are of warrior type, therefor use CLASS_WARRIOR. You need to set HP_usepotion to the HP you want to use a health potion at, and HP_sit to the HP you want to sit at (only effects when you're out of battle--typically this should be slightly higher than HP_usepotion).

Reiiko

Re: Shaiya bot

#9 Post by Reiiko » Thu Jan 24, 2008 3:41 pm

Is it good now? If so Pleas tell me how to get the Auto-Bot work on my computer so i can watch tv or something :P

Code: Select all

-------------------------------------------------
-- Variable declaration -- do not edit
-------------------------------------------------
CLASS_WARRIOR   = 0;
CLASS_MAGE      = 1;
HP              = 10000;
HPmax           = HP;
MP              = 10000;
MPmax           = MP;
SP              = 10000;
SPmax           = SP;

HP_ptr         = "020F2910";
HP_offset      = 296;
HPmax_ptr      = "020F2910";
HPmax_offset   = 300;

MP_ptr         = "020F2910";
MP_offset      = 304;
MPmax_ptr      = "020F2910";
MPmax_offset   = 308;

SP_ptr         = "020F2910";
SP_offset      = 312;
SPmax_ptr      = "020F2910";
SPmax_offset   = 316;

-------------------------------------------------


-------------------------------------------------
-- character configuration
-------------------------------------------------
class           = CLASS_WARRIOR;
key_attack      = key.VK_1;
key_pickup      = key.VK_2;
key_sit         = key.VK_C;

key_skill1      = key.VK_3;
key_skill2      = key.VK_4;
key_skill3      = key.VK_5;

key_hppotion    = key.VK_8;
key_mppotion    = key.VK_9;
key_sppotion    = key.VK_9;

-- rest or use potions when low on HP/MP/SP
HP_usepotion    = 350;
MP_usepotion    = 0;
SP_usepotion    = 0;

HP_sit          = 180;
MP_sit          = 0;
SP_sit          = 20;

-- chance to cast
skill1_chance   = 80;
skill2_chance   = 80;
skill3_chance   = 0;

-- MP cost
skill1_cost     = 15;
skill2_cost     = 20;
skill3_cost     = 25;

casttime        = 2000;
-------------------------------------------------

function use_hppotion()
  keyboardPress(key_hppotion);
end

function use_mppotion()
  keyboardPress(key_mppotion);
end

function use_sppotion()
  keyboardPress(key_sppotion);
end

-- so we aren't spamming the attack key...
-- we will use a timer to press it once
-- every 3 seconds.
function attack_timer()
  keyboardPress(key_attack);
end

function fight_warrior()
  registerTimer("attack_timer", 3000, attack_timer);

  while( have_target() ) do
    if( HP < HP_usepotion ) then
      use_hppotion(); end
    if( MP < MP_usepotion ) then
      use_mppotion(); end
    if( SP < SP_usepotion ) then
      use_sppotion(); end

    yrest(100);
    coroutine.yield();
  end

  unregisterTimer("attack_timer");

  yrest(1000);
  pickup();
end

function fight_mage()
  while( have_target() ) do
    if( HP < HP_usepotion ) then
      use_hppotion(); end
    if( MP < MP_usepotion ) then
      use_mppotion(); end
    if( SP < SP_usepotion ) then
      use_sppotion(); end

    local roll = math.random(100);
    if( roll <= skill1_chance and MP >= skill1_cost ) then
      -- cast skill 1
      keyboardPress(key_skill1);
      yrest(casttime);
    else
      keyboardPress(key_attack);
    end

    yrest(100);
    coroutine.yield();
  end

  yrest(1000);
  pickup();
end

-- heal until full HP & MP
function rest_heal()

  local last_HP = HP;

  keyboardPress(key_sit);
  yrest(100);
    while( HP < HPmax ) do
      if( HP < last_HP ) then
        print("Under attack! Exiting rest");
        return;
      else
        last_HP = HP;
      end

      yrest(100);
      coroutine.yield();
    end
  keyboardPress(key_sit);
  yrest(1000);
end

-- pickup nearby items
function pickup()
  for i = 1,5 do
    keyboardPress(key_pickup);
    yrest(500);
  end
end

-- update client variables by reading from it's memory
function update_vars()
  HP = memoryReadIntPtr(proc, HP_ptr, HP_offset);
  HPmax = memoryReadIntPtr(proc, HPmax_ptr, HPmax_offset);

  MP = memoryReadIntPtr(proc, MP_ptr, MP_offset);
  MPmax = memoryReadIntPtr(proc, MPmax_ptr, MPmax_offset);

  SP = memoryReadIntPtr(proc, SP_ptr, SP_offset);
  SPmax = memoryReadIntPtr(proc, SPmax_ptr, SPmax_offset);
end

function have_target()
  --1280*1024
  --  X: 345, Y: 36
  --  16bit: 165, 24, 66
  --  32bit: 163, 25, 65
  --1024*768
  --  X: 258, Y: 36
  --  16bit: 165, 28, 66
  --  32bit: 165, 30, 68

  local r,g,b;

  -- use the window's rect to find the resolution
  local wx,wy,ww,wh = windowRect(win);

  if( ww == 1024 and wh == 768 ) then
    r,g,b = getPixel(win, 258, 36);
  elseif( ww == 1280 and wh == 1024 ) then
    r,g,b = getPixel(win, 345, 36);
  else
    r,g,b = 0;
    print("Unsupported resolution! Please use 1024*768 or 1280*1024.");
  end

  --printf("R: %d, G: %d, B: %d\n", r, g, b);

  -- if there is still HP left in monster's HP bar...return true
  if( r >= 160 and r <= 170 and g >= 20 and g <= 34 and b >= 63 and b <= 73) then
    return true;
  else
    return false;
  end
end


-------------------------------------------------
-- FUNCTION MAIN
-------------------------------------------------
function main()
  proc = openProcess( findProcess("Shaiya") );
  win = findWindow("Shaiya");
  attach(win);

  registerTimer("update_vars", 100, update_vars);

  running = true;
  while( running ) do
    if( keyPressed(key.VK_F7) == 1 ) then
      running = false; end

    keyboardPress(key_attack);

    if( have_target() ) then
      if( class == CLASS_WARRIOR ) then
        fight_warrior();
      elseif( class == CLASS_MAGE ) then
        fight_mage();
      end
    end

    yrest(500);

    if( HP < HP_sit or MP < MP_sit or SP < SP_sit ) then
      rest_heal(); end

    yrest(200);
  end

  closeProcess(proc);
  detach();
end

startMacro(main);
-------------------------------------------------

Reiiko

Re: Shaiya bot

#10 Post by Reiiko » Thu Jan 24, 2008 3:56 pm


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

Re: Shaiya bot

#11 Post by Administrator » Thu Jan 24, 2008 4:59 pm

Yes, your modifications look correct. The problem now is that you do not have a bypass for GameGuard. GameGuard is what is preventing certain calls from taking place. One of those being openDC(). The result of openDC() is passed to getPixel(); since it is nil, the input is invalid, and you get an error.

Unfortunately, I cannot be of much help when it comes to looking for a bypass. I know there is GameGuardKiller. Perhaps you can search on Google and turn up some information about that, or similar software.

Reiiko

Re: Shaiya bot

#12 Post by Reiiko » Thu Jan 24, 2008 5:00 pm

Ok thank you

Pleas add me on MSN: Natalie_C@live.nl

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

Re: Shaiya bot

#13 Post by Administrator » Sat Jan 26, 2008 1:08 pm

Ok, here's the big break those of you that still play Shaiya have been waiting for. This was originally posted by Jewbacca/Ploxasaurus. http://www.sendspace.com/file/l2eaa2

Unrar it, and copy game.exe into C:\AeriaGames\Shaiya (by default, or wherever you installed Shaiya to), and let it overwrite.

I would also recommend that you create a simple loader to skip patching, and hence prevent (or at least, delay) this getting patched right away. You can create a new text file and put this text in it:

Code: Select all

game.exe start game
And save it as "loader.bat" without the quotes (Make sure you have the save type set to "All" and actually type in "loader.bat" into the save filename) into the Shaiya folder (same folder as game.exe). Now you can double click this file and it will bring up a MSDOS window, and launch Shaiya, skipping the updater.

You may notice that GameGuard still updates; this is normal. GameGuard will not actually launch and attach to Shaiya. Happy botting.

Guest

Re: Shaiya bot

#14 Post by Guest » Sat Jan 26, 2008 3:10 pm

hi im new at this i dl the shaiya.lua put it in the scirt folder then open macro then type in shaiya.lua i got to the game press f5 and saids

started...

Finished running the macro scripts.

and that all it dose it it becusa i dident patch it game.exe

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

Re: Shaiya bot

#15 Post by Administrator » Sat Jan 26, 2008 4:31 pm

Post your log.txt. And yes, you WILL need to patch game.exe, otherwise it will not work.

Guest

Re: Shaiya bot

#16 Post by Guest » Sat Jan 26, 2008 11:01 pm

elverion wrote:Post your log.txt. And yes, you WILL need to patch game.exe, otherwise it will not work.
i just patch the game.exe and when i run the macro still saids the samething and where can i find the log.txt

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

Re: Shaiya bot

#17 Post by Administrator » Sun Jan 27, 2008 1:10 am

You can find the log in the MicroMacro folder. It will be named log.txt. I have a feeling it's because I didn't update the HP/MP addresses. Hopefully, somebody will search for them and let me know.

Reiiko

Re: Shaiya bot

#18 Post by Reiiko » Sun Jan 27, 2008 5:51 am

This is the LOG: Sun Jan 27 11:44:13 2008 : MicroMacro v0.96
Sun Jan 27 11:44:13 2008 : Processor Type: 586, OS: Windows XP Service Pack 2
Sun Jan 27 11:44:13 2008 : Lua initialized successfully.
Sun Jan 27 11:44:13 2008 : Lua libs opened successfully.
Sun Jan 27 11:44:13 2008 : Lua glues exported.
Sun Jan 27 11:44:13 2008 : Configurations run.
Sun Jan 27 11:44:18 2008 : Executing script "shaiya.lua".
==================================================

Sun Jan 27 11:44:21 2008 : ...\Reiiko\Bureaublad\micromacro\micromacro\lib\lib.lua:105: Invalid data was supplied to getPixel().

Sun Jan 27 11:44:21 2008 : Execution of shaiya.lua complete.
Sun Jan 27 11:44:21 2008 : Execution success.
Sun Jan 27 11:44:21 2008 : Collecting garbage...
Sun Jan 27 11:44:21 2008 : GC closed process handle 0x4C.
Sun Jan 27 11:44:21 2008 : 19KB freed.


What did i do wrong?

Reiiko

Re: Shaiya bot

#19 Post by Reiiko » Sun Jan 27, 2008 6:16 am

How can i PATCH IT :(

Guest

Re: Shaiya bot

#20 Post by Guest » Sun Jan 27, 2008 12:27 pm

Reiiko wrote:How can i PATCH IT :(
u can get the game.exe here http://www.sendspace.com/file/l2eaa2 once u get the game.exe put it in ur shaiya folder

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests