Page 19 of 22

Re: Shaiya bot

Posted: Sat Dec 13, 2008 4:02 pm
by nightcrystal
hi.. i have a client for the AP region shaiya. Can i request a non-GG client? Can i send the file to ur email? im unable to attach it here due to 1mb limit. Thanks alot in advance.

Re: Shaiya bot

Posted: Sat Dec 13, 2008 4:49 pm
by Administrator
Send it to the e-mail address listed in my profile (use the e-mail link on the left of this message) as an attachment. Compress it to a zip archive first, though.

Re: Shaiya bot

Posted: Sun Dec 14, 2008 10:49 am
by nightcrystal
hmm sry..i fail to see any email link on the page. Maybe its due to account restriction? mind to pm me the address? thanks in advance.

Re: Shaiya bot

Posted: Sun Dec 14, 2008 12:53 pm
by Administrator

Re: Shaiya bot

Posted: Fri Dec 19, 2008 4:27 am
by Administrator
GameGuard patch and script have been updated. The new base address is 0x00825CB4. Please refer to step 1 in the first post in this thread for instructions on how to patch Shaiya.

Re: Shaiya bot

Posted: Fri Dec 19, 2008 6:13 am
by centik
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 Shaiya no GG patch (see attachments).

The archive will contain 3 files: upatch.exe, shaiya.up and shaiya.no.GG.upatch.bat. These should all be in the same folder as Shaiya's game.exe. Simply double click shaiya.no.GG.upatch.bat. A black window will pop up telling you that 4 changes were made and that you can close it. GameGuard has now been removed. Now just log in and play like normal.


Step 2: Create a loader.

Right click on your desktop, select New, and Shortcut.
Now click on Browse, and go to your Shaiya folder (ie. C:/AeriaGames/Shaiya/)
Select game.exe (Note: this may appear as just "game" depending on your computer settings)
Click Next, and Finish -- you're not done yet, though.
Right click on this newly made shortcut, and go to Properties.
Change the Target line to include the text 'start game' at the end (not including quotes!).
Your target line should now look like this: C:\AeriaGames\Shaiya\game.exe start game
Click OK, and you're now set.


hi..the GG remover doesnt seem to work on mine..i did just like the instruction says..it says 4changes and i did the loader but when i run the game the GG still pop up but now it doesnt show on my task bar..but still cant dual box

Re: Shaiya bot

Posted: Fri Dec 19, 2008 6:23 am
by zcarlz
The GG icon still pop out...
But I can use CE after I follow the instruction...

Re: Shaiya bot

Posted: Fri Dec 19, 2008 6:52 am
by Administrator
It works. Somewhat. It's just a temporary. It still lets GameGuard load, but it's inactive. I'm sure Jewbacca will release a proper patch soon, and it will be mirrored here when he does.

EDIT: Yeah, multi-clienting doesn't work (yet). It'll need a proper removal before that works without error. Be patient.

Re: Shaiya bot

Posted: Sun Dec 21, 2008 1:07 am
by vvayinsane
Im trying to get this bot to work cause its the easy..i think.

Im trying to get the address i first search for 65535. Then go and click a target and put 0 and keep going back and forth. I know im doing something wrong. Im not getting what i need...

Am i on the right track?

Re: Shaiya bot

Posted: Sun Dec 21, 2008 1:47 am
by Administrator
Close. Search for short (2 bytes) 655535 when you do not have a target. Then target a monster and filter by "Changed Value". Then deselect the target and filter 65535 again. You get the idea.

Re: Shaiya bot

Posted: Sun Dec 21, 2008 5:13 pm
by vvayinsane
hey, i did what you said and i got 6 different address. Three of them are green and the other three are not green. I put the green ones in shaiya.lua and it doesnt work. Then i tried find what access these address. They all have the same number 006D0BC. I then do a new scan click hex and i get nothing but non green numbers.

Re: Shaiya bot

Posted: Sun Dec 21, 2008 5:38 pm
by Administrator
You're looking for the offset, not the address.
Image

You're looking at the top thing. The offset is 0x12C in that example.

Re: Shaiya bot

Posted: Sun Dec 21, 2008 5:55 pm
by vvayinsane
ok

Re: Shaiya bot

Posted: Sun Dec 21, 2008 7:12 pm
by vvayinsane
I figured it out..lol..took me a sec but i actually relised that the offset is the targetid im looking for...Thanks for your help admin couldnt have found it with out you..

YOu can either replace the line in shaiya
targetid_addr = 0x006d0bc4;

Re: Shaiya bot

Posted: Mon Dec 22, 2008 5:48 am
by Administrator
Thanks for taking the time to find it. I'll go ahead and update the main Shaiya bot thread with your fix.

Re: Shaiya bot

Posted: Fri Apr 10, 2009 11:14 am
by Nasa210
my guy doesnt uise potions at all... is there something wrong?

Code: Select all

-------------------------------------------------------------------
-------------------------------------------------------------------
-- Title:           Shaiya Bot                                   --
-- Author:          Elverion                                     --
-- Date:            May 29, 2008                                 --
-- Requirements:    MicroMacro v0.97                             --
-- License:         Public Domain                                --
-------------------------------------------------------------------
-------------------------------------------------------------------
-- This script is public domain. You may use it in any way you   --
-- find appropriate without restriction. This includes, but is   --
-- not limited to, modification and distribution, whether it be  --
-- commercial or not.                                            --
-------------------------------------------------------------------
-------------------------------------------------------------------




------------------------------------------------
-- HOTKEYS
------------------------------------------------
startKey = key.VK_INSERT;
stopKey = key.VK_DELETE;

key_switchtarget = key.VK_TILDE;

key_attack  = key.VK_1;
key_pickup  = key.VK_2;

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

key_buff1   = key.VK_6;
key_buff2   = key.VK_7;

key_hp_potion = key.VK_8;
key_mp_potion = key.VK_9;
key_sp_potion = key.VK_0;

key_sit       = key.VK_C;


------------------------------------------------
-- SKILLS
------------------------------------------------
-- Set to 0 if you don't want to use a skill
skill1_time = secondsToTimer(15);
skill2_time = secondsToTimer(18);
skill3_time = secondsToTimer(20);


------------------------------------------------
-- BUFFS
------------------------------------------------
-- Set a buff to 0 if you don't want to use it
buff1_time = minutesToTimer(5);
buff2_time = minutesToTimer(10);

------------------------------------------------
-- POTIONS
------------------------------------------------
-- All potion use values are specified in %
-- Set the values to 0 to not use that potion
HP_potion_use = 50;
MP_potion_use = 40;
SP_potion_use = 35;


------------------------------------------------
-- SITTING
------------------------------------------------
-- All sitting values are specified in %
-- We will only sit while out of battle
-- Set the values to 0 to not use sitting
HP_sit = 90;
MP_sit = 20;
SP_sit = 10;


--[[*********************************************************************
**************************************************************************
    DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
**************************************************************************
************************************************************************]]

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x00825CB4;

HP_offset = 0x12C; 
MaxHP_offset = 0x130; -- 304
MP_offset = 0x134; --308;
MaxMP_offset = 0x138; --312;
SP_offset = 0x13C; --316;
MaxSP_offset = 0x140; --320;

targetid_addr = 0x006d0bc4; -- short, 65535 if none selected

sitcheck_addr = 0x006E5D40; -- byte, 0 = standing, 7 = sitting


------------------------------------------------
-- Variable setup
------------------------------------------------
HP = 10000;
MaxHP = HP;
MP = 10000;
MaxMP = MP;
SP = 10000;
MaxSP = SP;

skill1_ready = true;
skill2_ready = true;
skill3_ready = true;

buff1_ready = true;
buff2_ready = true;

sittingTempDisabled = false; -- don't change this. it's just temporary.

------------------------------------------------
-- Functions
------------------------------------------------

skill1_toggle = function () skill1_ready = true; end;
skill2_toggle = function () skill2_ready = true; end;
skill3_toggle = function () skill3_ready = true; end;

buff1_toggle = function () buff1_ready = true; end;
buff2_toggle = function () buff2_ready = true; end;


function use_hp_potion()
  keyboardPress(key_hp_potion);
  printf("Using HP potion\n");
end


function use_mp_potion()
  keyboardPress(key_mp_potion);
  printf("Using MP potion\n");
end


function use_sp_potion()
  keyboardPress(key_sp_potion);
  printf("Using SP potion\n");
end

function tempDisableSitting()
  sittingTempDisabled = true;

  registerTimer("reenable_sitting", secondsToTimer(5),
    function () sittingTempDisabled = false unregisterTimer("reenable_sitting") end );
end

function sit()
  if( HP_sit == 0 ) then
    return; end

  printf("Sitting.\n");

  local sitting = false;
  while( sitting == false ) do
    keyboardPress(key_sit);
    yrest(1000);

    sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
  end

  local lasthp = HP;

  while( true ) do
    if( HP == MaxHP and MP == MaxMP and SP == MaxSP ) then
      switch_target();
      break;
    end

    if( HP < (lasthp - 10) ) then
      printf("Exiting rest...under attack\n");
      tempDisableSitting(); -- so we don't end up sitting right away again
      break;
    else
      lasthp = HP;
    end

    yrest(100);
  end

  sitting = true;
  while( sitting ) do
    keyboardPress(key_sit);
    yrest(1000);

    sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
  end

  printf("Standing... Resuming bot\n");
  yrest(1000);
end


function pickup()
  printf("Pickup!\n");
  if( key_pickup == 0 ) then return; end

  local i;
  for i = 0, 5 do
    keyboardPress(key_pickup);
    yrest(500);
  end

  yrest(1000);
end


function update_vars()
  HP = memoryReadIntPtr(proc, playerptr_addr, HP_offset);
  MaxHP = memoryReadIntPtr(proc, playerptr_addr, MaxHP_offset);

  MP = memoryReadIntPtr(proc, playerptr_addr, MP_offset);
  MaxMP = memoryReadIntPtr(proc, playerptr_addr, MaxMP_offset);

  SP = memoryReadIntPtr(proc, playerptr_addr, SP_offset);
  MaxSP = memoryReadIntPtr(proc, playerptr_addr, MaxSP_offset);
end


function have_target()
  local readid = memoryReadShort(proc, targetid_addr);

  return ( readid ~= 0xFFFF );
end

function find_target()
  keyboardPress(key_attack);
end

function switch_target()
  keyboardPress(key_switchtarget);
end


------------------------------------------------
-- FIGHT
------------------------------------------------
function fight()
  local beginTime = os.time();
  local attack_ready = true;

  local attack_toggle = function () attack_ready = true; end;
  registerTimer("attack_timer", secondsToTimer(3), attack_toggle); 

  local targetid = memoryReadByte(proc, targetid_addr);
  printf("TARGETID: %d\n", targetid);

  while( have_target() ) do
    local curtarget = memoryReadByte(proc, targetid_addr);
    if( targetid ~= curtarget ) then break; end;

    local currentTime = os.time();
    if( os.difftime(currentTime, beginTime) > 60 ) then -- more than 1 minute has passed
      keyboardPress(key_switchtarget);
      break; -- exit combat
    end

    if( skill1_ready  and skill1_time > 0 ) then
      keyboardPress(key_skill1); skill1_ready = false; yrest(1000);
      registerTimer("skill1_toggle", skill1_time, skill1_toggle);
    end;

    if( skill2_ready and skill2_time > 0) then
      keyboardPress(key_skill2); skill2_ready = false; yrest(1000);
      registerTimer("skill2_toggle", skill2_time, skill2_toggle);
    end;

    if( skill3_ready and skill3_time > 0) then
      keyboardPress(key_skill3); skill3_ready = false; yrest(1000);
      registerTimer("skill3_toggle", skill3_time, skill3_toggle);
    end;

    if( attack_ready ) then
      keyboardPress(key_attack); attack_ready = false; yrest(1000); end;

    if( (HP/MaxHP*100) < HP_potion_use and HP_potion_use > 0 ) then use_hp_potion(); end
    if( (MP/MaxMP*100) < MP_potion_use and MP_potion_use > 0 ) then use_mp_potion(); end
    if( (SP/MaxSP*100) < SP_potion_use and SP_potion_use > 0 ) then use_sp_potion(); end

    if( buff1_ready  and buff1_time > 0 ) then
      keyboardPress(key_buff1); buff1_ready = false; yrest(2000); end;
    if( buff2_ready  and buff2_time > 0 ) then
      keyboardPress(key_buff2); buff2_ready = false; yrest(2000); end;

    yrest(100);
  end

  printf("Target lost.\n");

  unregisterTimer("attack_timer");

  pickup()
end


------------------------------------------------
-- MAIN
------------------------------------------------
function main()
  proc = openProcess(findProcessByExe("game.exe"));
  win = findWindow("Shaiya");
  setPriority(PRIORITY_HIGH);

  registerTimer("update_vars", 100, update_vars);

  if( skill1_time ) then registerTimer("skill1_toggle", skill1_time, skill1_toggle); end
  if( skill2_time ) then registerTimer("skill2_toggle", skill2_time, skill2_toggle); end
  if( skill3_time ) then registerTimer("skill3_toggle", skill3_time, skill3_toggle); end

  if( buff1_time ) then registerTimer("buff1_toggle", buff1_time, buff1_toggle); end;
  if( buff2_time ) then registerTimer("buff2_toggle", buff2_time, buff2_toggle); end;

  while( true ) do
    find_target();

    yrest(200);

    if( have_target() ) then
      fight();
    end

    if( buff1_ready  and buff1_time > 0 ) then
      keyboardPress(key_buff1); buff1_ready = false; yrest(2000); end;
    if( buff2_ready  and buff2_time > 0 ) then
      keyboardPress(key_buff2); buff2_ready = false; yrest(2000); end;

    if( (HP/MaxHP*100) < HP_potion_use and HP_potion_use > 50 ) then use_hp_potion(); end
    if( (MP/MaxMP*100) < MP_potion_use and MP_potion_use > 50 ) then use_mp_potion(); end
    if( (SP/MaxSP*100) < SP_potion_use and SP_potion_use > 50 ) then use_sp_potion(); end

    if( not sittingTempDisabled ) then
      if( (HP/MaxHP*100) < HP_sit and (HP_sit > 0) ) then sit(); end
      if( (MP/MaxMP*100) < MP_sit and (MP_sit > 0) ) then sit(); end
      if( (SP/MaxSP*100) < SP_sit and (SP_sit > 0) ) then sit(); end
    end
    
  end
end

startMacro(main);

Re: Shaiya bot

Posted: Fri Apr 10, 2009 10:12 pm
by NovatonX
Nasa210 wrote:my guy doesnt uise potions at all... is there something wrong?

Code: Select all

-------------------------------------------------------------------
-------------------------------------------------------------------
-- Title:           Shaiya Bot                                   --
-- Author:          Elverion                                     --
-- Date:            May 29, 2008                                 --
-- Requirements:    MicroMacro v0.97                             --
-- License:         Public Domain                                --
-------------------------------------------------------------------
-------------------------------------------------------------------
-- This script is public domain. You may use it in any way you   --
-- find appropriate without restriction. This includes, but is   --
-- not limited to, modification and distribution, whether it be  --
-- commercial or not.                                            --
-------------------------------------------------------------------
-------------------------------------------------------------------




------------------------------------------------
-- HOTKEYS
------------------------------------------------
startKey = key.VK_INSERT;
stopKey = key.VK_DELETE;

key_switchtarget = key.VK_TILDE;

key_attack  = key.VK_1;
key_pickup  = key.VK_2;

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

key_buff1   = key.VK_6;
key_buff2   = key.VK_7;

key_hp_potion = key.VK_8;
key_mp_potion = key.VK_9;
key_sp_potion = key.VK_0;

key_sit       = key.VK_C;


------------------------------------------------
-- SKILLS
------------------------------------------------
-- Set to 0 if you don't want to use a skill
skill1_time = secondsToTimer(15);
skill2_time = secondsToTimer(18);
skill3_time = secondsToTimer(20);


------------------------------------------------
-- BUFFS
------------------------------------------------
-- Set a buff to 0 if you don't want to use it
buff1_time = minutesToTimer(5);
buff2_time = minutesToTimer(10);

------------------------------------------------
-- POTIONS
------------------------------------------------
-- All potion use values are specified in %
-- Set the values to 0 to not use that potion
HP_potion_use = 50;
MP_potion_use = 40;
SP_potion_use = 35;


------------------------------------------------
-- SITTING
------------------------------------------------
-- All sitting values are specified in %
-- We will only sit while out of battle
-- Set the values to 0 to not use sitting
HP_sit = 90;
MP_sit = 20;
SP_sit = 10;


--[[*********************************************************************
**************************************************************************
    DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
**************************************************************************
************************************************************************]]

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x00825CB4;

HP_offset = 0x12C; 
MaxHP_offset = 0x130; -- 304
MP_offset = 0x134; --308;
MaxMP_offset = 0x138; --312;
SP_offset = 0x13C; --316;
MaxSP_offset = 0x140; --320;

targetid_addr = 0x006d0bc4; -- short, 65535 if none selected

sitcheck_addr = 0x006E5D40; -- byte, 0 = standing, 7 = sitting


------------------------------------------------
-- Variable setup
------------------------------------------------
HP = 10000;
MaxHP = HP;
MP = 10000;
MaxMP = MP;
SP = 10000;
MaxSP = SP;

skill1_ready = true;
skill2_ready = true;
skill3_ready = true;

buff1_ready = true;
buff2_ready = true;

sittingTempDisabled = false; -- don't change this. it's just temporary.

------------------------------------------------
-- Functions
------------------------------------------------

skill1_toggle = function () skill1_ready = true; end;
skill2_toggle = function () skill2_ready = true; end;
skill3_toggle = function () skill3_ready = true; end;

buff1_toggle = function () buff1_ready = true; end;
buff2_toggle = function () buff2_ready = true; end;


function use_hp_potion()
  keyboardPress(key_hp_potion);
  printf("Using HP potion\n");
end


function use_mp_potion()
  keyboardPress(key_mp_potion);
  printf("Using MP potion\n");
end


function use_sp_potion()
  keyboardPress(key_sp_potion);
  printf("Using SP potion\n");
end

function tempDisableSitting()
  sittingTempDisabled = true;

  registerTimer("reenable_sitting", secondsToTimer(5),
    function () sittingTempDisabled = false unregisterTimer("reenable_sitting") end );
end

function sit()
  if( HP_sit == 0 ) then
    return; end

  printf("Sitting.\n");

  local sitting = false;
  while( sitting == false ) do
    keyboardPress(key_sit);
    yrest(1000);

    sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
  end

  local lasthp = HP;

  while( true ) do
    if( HP == MaxHP and MP == MaxMP and SP == MaxSP ) then
      switch_target();
      break;
    end

    if( HP < (lasthp - 10) ) then
      printf("Exiting rest...under attack\n");
      tempDisableSitting(); -- so we don't end up sitting right away again
      break;
    else
      lasthp = HP;
    end

    yrest(100);
  end

  sitting = true;
  while( sitting ) do
    keyboardPress(key_sit);
    yrest(1000);

    sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
  end

  printf("Standing... Resuming bot\n");
  yrest(1000);
end


function pickup()
  printf("Pickup!\n");
  if( key_pickup == 0 ) then return; end

  local i;
  for i = 0, 5 do
    keyboardPress(key_pickup);
    yrest(500);
  end

  yrest(1000);
end


function update_vars()
  HP = memoryReadIntPtr(proc, playerptr_addr, HP_offset);
  MaxHP = memoryReadIntPtr(proc, playerptr_addr, MaxHP_offset);

  MP = memoryReadIntPtr(proc, playerptr_addr, MP_offset);
  MaxMP = memoryReadIntPtr(proc, playerptr_addr, MaxMP_offset);

  SP = memoryReadIntPtr(proc, playerptr_addr, SP_offset);
  MaxSP = memoryReadIntPtr(proc, playerptr_addr, MaxSP_offset);
end


function have_target()
  local readid = memoryReadShort(proc, targetid_addr);

  return ( readid ~= 0xFFFF );
end

function find_target()
  keyboardPress(key_attack);
end

function switch_target()
  keyboardPress(key_switchtarget);
end


------------------------------------------------
-- FIGHT
------------------------------------------------
function fight()
  local beginTime = os.time();
  local attack_ready = true;

  local attack_toggle = function () attack_ready = true; end;
  registerTimer("attack_timer", secondsToTimer(3), attack_toggle); 

  local targetid = memoryReadByte(proc, targetid_addr);
  printf("TARGETID: %d\n", targetid);

  while( have_target() ) do
    local curtarget = memoryReadByte(proc, targetid_addr);
    if( targetid ~= curtarget ) then break; end;

    local currentTime = os.time();
    if( os.difftime(currentTime, beginTime) > 60 ) then -- more than 1 minute has passed
      keyboardPress(key_switchtarget);
      break; -- exit combat
    end

    if( skill1_ready  and skill1_time > 0 ) then
      keyboardPress(key_skill1); skill1_ready = false; yrest(1000);
      registerTimer("skill1_toggle", skill1_time, skill1_toggle);
    end;

    if( skill2_ready and skill2_time > 0) then
      keyboardPress(key_skill2); skill2_ready = false; yrest(1000);
      registerTimer("skill2_toggle", skill2_time, skill2_toggle);
    end;

    if( skill3_ready and skill3_time > 0) then
      keyboardPress(key_skill3); skill3_ready = false; yrest(1000);
      registerTimer("skill3_toggle", skill3_time, skill3_toggle);
    end;

    if( attack_ready ) then
      keyboardPress(key_attack); attack_ready = false; yrest(1000); end;

    if( (HP/MaxHP*100) < HP_potion_use and HP_potion_use > 0 ) then use_hp_potion(); end
    if( (MP/MaxMP*100) < MP_potion_use and MP_potion_use > 0 ) then use_mp_potion(); end
    if( (SP/MaxSP*100) < SP_potion_use and SP_potion_use > 0 ) then use_sp_potion(); end

    if( buff1_ready  and buff1_time > 0 ) then
      keyboardPress(key_buff1); buff1_ready = false; yrest(2000); end;
    if( buff2_ready  and buff2_time > 0 ) then
      keyboardPress(key_buff2); buff2_ready = false; yrest(2000); end;

    yrest(100);
  end

  printf("Target lost.\n");

  unregisterTimer("attack_timer");

  pickup()
end


------------------------------------------------
-- MAIN
------------------------------------------------
function main()
  proc = openProcess(findProcessByExe("game.exe"));
  win = findWindow("Shaiya");
  setPriority(PRIORITY_HIGH);

  registerTimer("update_vars", 100, update_vars);

  if( skill1_time ) then registerTimer("skill1_toggle", skill1_time, skill1_toggle); end
  if( skill2_time ) then registerTimer("skill2_toggle", skill2_time, skill2_toggle); end
  if( skill3_time ) then registerTimer("skill3_toggle", skill3_time, skill3_toggle); end

  if( buff1_time ) then registerTimer("buff1_toggle", buff1_time, buff1_toggle); end;
  if( buff2_time ) then registerTimer("buff2_toggle", buff2_time, buff2_toggle); end;

  while( true ) do
    find_target();

    yrest(200);

    if( have_target() ) then
      fight();
    end

    if( buff1_ready  and buff1_time > 0 ) then
      keyboardPress(key_buff1); buff1_ready = false; yrest(2000); end;
    if( buff2_ready  and buff2_time > 0 ) then
      keyboardPress(key_buff2); buff2_ready = false; yrest(2000); end;

    if( (HP/MaxHP*100) < HP_potion_use and HP_potion_use > 50 ) then use_hp_potion(); end
    if( (MP/MaxMP*100) < MP_potion_use and MP_potion_use > 50 ) then use_mp_potion(); end
    if( (SP/MaxSP*100) < SP_potion_use and SP_potion_use > 50 ) then use_sp_potion(); end

    if( not sittingTempDisabled ) then
      if( (HP/MaxHP*100) < HP_sit and (HP_sit > 0) ) then sit(); end
      if( (MP/MaxMP*100) < MP_sit and (MP_sit > 0) ) then sit(); end
      if( (SP/MaxSP*100) < SP_sit and (SP_sit > 0) ) then sit(); end
    end
    
  end
end

startMacro(main);

This happens to me too, please help

Re: Shaiya bot

Posted: Sat Apr 11, 2009 12:07 am
by NovatonX

Code: Select all

-------------------------------------------------------------------
-------------------------------------------------------------------
-- Title:           Shaiya Bot                                   --
-- Author:          Elverion                                     --
-- Date:            May 29, 2008                                 --
-- Requirements:    MicroMacro v0.97                             --
-- License:         Public Domain                                --
-------------------------------------------------------------------
-------------------------------------------------------------------
-- This script is public domain. You may use it in any way you   --
-- find appropriate without restriction. This includes, but is   --
-- not limited to, modification and distribution, whether it be  --
-- commercial or not.                                            --
-------------------------------------------------------------------
-------------------------------------------------------------------




------------------------------------------------
-- HOTKEYS
------------------------------------------------
startKey = key.VK_INSERT;
stopKey = key.VK_DELETE;

key_switchtarget = key.VK_TILDE;

key_attack  = key.VK_4;
key_pickup  = key.VK_1;

key_skill1  = key.VK_3;
key_skill2  = key.VK_3;
key_skill3  = key.VK_2;

key_buff1   = key.VK_8;
key_buff2   = key.VK_9;

key_hp_potion = key.VK_5;
key_mp_potion = key.VK_7;
key_sp_potion = key.VK_6;

key_sit       = key.VK_C;


------------------------------------------------
-- SKILLS
------------------------------------------------
-- Set to 0 if you don't want to use a skill
skill1_time = secondsToTimer(15);
skill2_time = secondsToTimer(18);
skill3_time = secondsToTimer(20);


------------------------------------------------
-- BUFFS
------------------------------------------------
-- Set a buff to 0 if you don't want to use it
buff1_time = minutesToTimer(5);
buff2_time = minutesToTimer(10);

------------------------------------------------
-- POTIONS
------------------------------------------------
-- All potion use values are specified in %
-- Set the values to 0 to not use that potion
HP_potion_use = 55;
MP_potion_use = 40;
SP_potion_use = 35;


------------------------------------------------
-- SITTING
------------------------------------------------
-- All sitting values are specified in %
-- We will only sit while out of battle
-- Set the values to 0 to not use sitting
HP_sit = 90;
MP_sit = 20;
SP_sit = 10;


--[[*********************************************************************
**************************************************************************
    DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
**************************************************************************
************************************************************************]]

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x00825CB4;

HP_offset = 0x12C; 
MaxHP_offset = 0x130; -- 304
MP_offset = 0x134; --308;
MaxMP_offset = 0x138; --312;
SP_offset = 0x13C; --316;
MaxSP_offset = 0x140; --320;

targetid_addr = 0x006d0bc4; -- short, 65535 if none selected

sitcheck_addr = 0x006E5D40; -- byte, 0 = standing, 7 = sitting


------------------------------------------------
-- Variable setup
------------------------------------------------
HP = 1019;
MaxHP = HP;
MP = 102;
MaxMP = MP;
SP = 482;
MaxSP = SP;

skill1_ready = true;
skill2_ready = true;
skill3_ready = true;

buff1_ready = true;
buff2_ready = true;

sittingTempDisabled = false; -- don't change this. it's just temporary.

------------------------------------------------
-- Functions
------------------------------------------------

skill1_toggle = function () skill1_ready = true; end;
skill2_toggle = function () skill2_ready = true; end;
skill3_toggle = function () skill3_ready = true; end;

buff1_toggle = function () buff1_ready = true; end;
buff2_toggle = function () buff2_ready = true; end;


function use_hp_potion()
  keyboardPress(key_hp_potion);
  printf("Using HP potion\n");
end


function use_mp_potion()
  keyboardPress(key_mp_potion);
  printf("Using MP potion\n");
end


function use_sp_potion()
  keyboardPress(key_sp_potion);
  printf("Using SP potion\n");
end

function tempDisableSitting()
  sittingTempDisabled = true;

  registerTimer("reenable_sitting", secondsToTimer(5),
    function () sittingTempDisabled = false unregisterTimer("reenable_sitting") end );
end

function sit()
  if( HP_sit == 0 ) then
    return; end

  printf("Sitting.\n");

  local sitting = false;
  while( sitting == false ) do
    keyboardPress(key_sit);
    yrest(1000);

    sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
  end

  local lasthp = HP;

  while( true ) do
    if( HP == MaxHP and MP == MaxMP and SP == MaxSP ) then
      switch_target();
      break;
    end

    if( HP < (lasthp - 10) ) then
      printf("Exiting rest...under attack\n");
      tempDisableSitting(); -- so we don't end up sitting right away again
      break;
    else
      lasthp = HP;
    end

    yrest(100);
  end

  sitting = true;
  while( sitting ) do
    keyboardPress(key_sit);
    yrest(1000);

    sitting = memoryReadByte(proc, sitcheck_addr) ~= 0;
  end

  printf("Standing... Resuming bot\n");
  yrest(1000);
end


function pickup()
  printf("Pickup!\n");
  if( key_pickup == 0 ) then return; end

  local i;
  for i = 0, 5 do
    keyboardPress(key_pickup);
    yrest(500);
  end

  yrest(1000);
end


function update_vars()
  HP = memoryReadIntPtr(proc, playerptr_addr, HP_offset);
  MaxHP = memoryReadIntPtr(proc, playerptr_addr, MaxHP_offset);

  MP = memoryReadIntPtr(proc, playerptr_addr, MP_offset);
  MaxMP = memoryReadIntPtr(proc, playerptr_addr, MaxMP_offset);

  SP = memoryReadIntPtr(proc, playerptr_addr, SP_offset);
  MaxSP = memoryReadIntPtr(proc, playerptr_addr, MaxSP_offset);
end


function have_target()
  local readid = memoryReadShort(proc, targetid_addr);

  return ( readid ~= 0xFFFF );
end

function find_target()
  keyboardPress(key_attack);
end

function switch_target()
  keyboardPress(key_switchtarget);
end


------------------------------------------------
-- FIGHT
------------------------------------------------
function fight()
  local beginTime = os.time();
  local attack_ready = true;

  local attack_toggle = function () attack_ready = true; end;
  registerTimer("attack_timer", secondsToTimer(3), attack_toggle); 

  local targetid = memoryReadByte(proc, targetid_addr);
  printf("TARGETID: %d\n", targetid);

  while( have_target() ) do
    local curtarget = memoryReadByte(proc, targetid_addr);
    if( targetid ~= curtarget ) then break; end;

    local currentTime = os.time();
    if( os.difftime(currentTime, beginTime) > 60 ) then -- more than 1 minute has passed
      keyboardPress(key_switchtarget);
      break; -- exit combat
    end

    if( skill1_ready  and skill1_time > 0 ) then
      keyboardPress(key_skill1); skill1_ready = false; yrest(1000);
      registerTimer("skill1_toggle", skill1_time, skill1_toggle);
    end;

    if( skill2_ready and skill2_time > 0) then
      keyboardPress(key_skill2); skill2_ready = false; yrest(1000);
      registerTimer("skill2_toggle", skill2_time, skill2_toggle);
    end;

    if( skill3_ready and skill3_time > 0) then
      keyboardPress(key_skill3); skill3_ready = false; yrest(1000);
      registerTimer("skill3_toggle", skill3_time, skill3_toggle);
    end;

    if( attack_ready ) then
      keyboardPress(key_attack); attack_ready = false; yrest(1000); end;

    if( (HP/MaxHP*100) < HP_potion_use and HP_potion_use > 0 ) then use_hp_potion(); end
    if( (MP/MaxMP*100) < MP_potion_use and MP_potion_use > 0 ) then use_mp_potion(); end
    if( (SP/MaxSP*100) < SP_potion_use and SP_potion_use > 0 ) then use_sp_potion(); end

    if( buff1_ready  and buff1_time > 0 ) then
      keyboardPress(key_buff1); buff1_ready = false; yrest(2000); end;
    if( buff2_ready  and buff2_time > 0 ) then
      keyboardPress(key_buff2); buff2_ready = false; yrest(2000); end;

    yrest(100);
  end

  printf("Target lost.\n");

  unregisterTimer("attack_timer");

  pickup()
end


------------------------------------------------
-- MAIN
------------------------------------------------
function main()
  proc = openProcess(findProcessByExe("game.exe"));
  win = findWindow("Shaiya");
  setPriority(PRIORITY_HIGH);

  registerTimer("update_vars", 100, update_vars);

  if( skill1_time ) then registerTimer("skill1_toggle", skill1_time, skill1_toggle); end
  if( skill2_time ) then registerTimer("skill2_toggle", skill2_time, skill2_toggle); end
  if( skill3_time ) then registerTimer("skill3_toggle", skill3_time, skill3_toggle); end

  if( buff1_time ) then registerTimer("buff1_toggle", buff1_time, buff1_toggle); end;
  if( buff2_time ) then registerTimer("buff2_toggle", buff2_time, buff2_toggle); end;

  while( true ) do
    find_target();

    yrest(200);

    if( have_target() ) then
      fight();
    end

    if( buff1_ready  and buff1_time > 0 ) then
      keyboardPress(key_buff1); buff1_ready = false; yrest(2000); end;
    if( buff2_ready  and buff2_time > 0 ) then
      keyboardPress(key_buff2); buff2_ready = false; yrest(2000); end;

    if( (HP/MaxHP*100) < HP_potion_use and HP_potion_use > 0 ) then use_hp_potion(); end
    if( (MP/MaxMP*100) < MP_potion_use and MP_potion_use > 0 ) then use_mp_potion(); end
    if( (SP/MaxSP*100) < SP_potion_use and SP_potion_use > 0 ) then use_sp_potion(); end

    if( not sittingTempDisabled ) then
      if( (HP/MaxHP*100) < HP_sit and (HP_sit > 0) ) then sit(); end
      if( (MP/MaxMP*100) < MP_sit and (MP_sit > 0) ) then sit(); end
      if( (SP/MaxSP*100) < SP_sit and (SP_sit > 0) ) then sit(); end
    end
    
  end
end

startMacro(main);

oh and this is my script ^^^
He wont sit either

Re: Shaiya bot

Posted: Mon Apr 13, 2009 12:47 pm
by Administrator
The GameGuard patch and script have been updated. This should correct the problem.

Re: Shaiya bot

Posted: Mon Apr 13, 2009 7:57 pm
by NovatonX
the sitting works but now my dude aint changing targets

Edit: wait never mind its good

Edit Edit: now he sits during battle lol