Shaiya bot

For any other game that doesn't have its own section.
Message
Author
vvayinsane
Posts: 148
Joined: Fri Mar 21, 2008 9:10 pm

Re: Shaiya bot

#181 Post by vvayinsane » Mon Mar 24, 2008 4:57 pm

I figured it out...the bot works fine its something i didnt do. I miss read the shaiya.lua file and put the wrong numbers in for HP poistions. I saw the % sign but never actually notice it. Well after looking at the script over and over and over while doing the address i notice it. I put 50 and the bot heals at 50 percent. lol sorry every but thanks for your help. Well i learned from my mistake..lol

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

Re: Shaiya bot

#182 Post by Administrator » Mon Mar 24, 2008 5:06 pm

No problem. At least you learned something :) If you notice anything out of sorts, feel free to report it to me and I'll be glad to look into it with you.

Dreamnotez
Posts: 1
Joined: Mon Mar 24, 2008 8:21 pm
Contact:

Re: Shaiya bot

#183 Post by Dreamnotez » Mon Mar 24, 2008 8:29 pm

oki... there has to be something i'm doing wrong. i downloaded Shaiya.. installed it to my comp and let the game run normally so it would upgrade to the latest version of Shaiya. I then downloaded the no game guard patch and after unzipping it i replaced the game.exe file with the new one. i then created a loader on my desktop and ran it but i still got the "game hack has been found". i tried everything to get this working and don-t know what to do anymore. i tried uninstalling/reinstalling, running it without the upgrade, creating a shortcut loader and also a text loader but nothing works.. i even tried shutting down almost ALL processes and it still didin-t work and keeps saying that it found a hack.

if anyone knows how to help me i'd appreciate it soooo much.

=val

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

Re: Shaiya bot

#184 Post by Administrator » Tue Mar 25, 2008 12:55 am

When you open the launcher that you made, does it bring up the Shaiya patcher, or does it directly launch the game? As long as you've extracted game.exe from the ZIP, and overwrote, I don't understand how it's possible that GameGuard is opening. Delete the game.exe you have in C:/AeriaGames/Shaiya/ (or whatever the folder is), and then put the patch in there. This might help to work around any sort of strange issues that could be coming into play (such as hash checks).
i even tried shutting down almost ALL processes and it still didin-t work and keeps saying that it found a hack.
It is most likely a hidden system driver. Have you ever installed Cheat Engine on your computer (even if you have since uninstalled it)? If so, Cheat Engine might've installed a system driver that it uses, depending on your settings. It could also be a rootkit. There's also a plethora of keyboard drivers that are detected as "hacks" by GameGuard.

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

Re: Shaiya bot

#185 Post by vvayinsane » Tue Mar 25, 2008 10:41 pm

A friend of mine has windows vista. Her husband has windows vista also. He is able to get the bot to work with the script but when she trys to use the script she gets
Tue Mar 25 21:18:02 2008 : ...Users\Stpdliku\Desktop\micromacro\scripts\shaiya.lua:202: Invalid data was supplied to memoryReadShort().

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

Re: Shaiya bot

#186 Post by Administrator » Wed Mar 26, 2008 12:20 am

Does she have UAC enabled or disabled? Is she running it as administrator? Running as compatibility mode for XP? Did she delete the micromacro.exe.manifest?

MrsBlubb
Posts: 2
Joined: Thu Mar 27, 2008 6:45 am

Re: Shaiya bot

#187 Post by MrsBlubb » Thu Mar 27, 2008 6:55 am

Hi :)
First of all: Thanks for this nice bot!
I tried it and on my archer it works really nice...
For my priest I tried some changes.... The most important thing for mage and priest is to to get the attack button off, thats what I did... and for finding monsters I wanted to trie the '^' (german keyboard) or '~' (englich keyboard) button, but didnt work :O
'^' doesnt exist in the keymap.lua and the '~' didnt work...I have no idea why :)
Maybe someone has an idea how to select monsters without the attack skill? Cause then mages can easily use this bot, too.
Thanks for help!
MrsBlubb

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

Re: Shaiya bot

#188 Post by Administrator » Thu Mar 27, 2008 12:27 pm

the '~' didnt work...I have no idea why
Were you using key.VK_TILDE? ^ is the same as 6 on the numerical row for English keyboards, so it hasn't been specifically mapped. You should be able to use key.VK_TILDE to invoke a ^ as it's in the same place (but it depends entirely upon hardware scancodes...so who knows).

MrsBlubb
Posts: 2
Joined: Thu Mar 27, 2008 6:45 am

Re: Shaiya bot

#189 Post by MrsBlubb » Thu Mar 27, 2008 12:50 pm

i tried key.VK_TILDE , but it didn't work for me. i also tried english keyboard layout in windows settings, but: no reaction. i think its because hardware scancodes as u wrote. anyone gots an idea how i can emulate english keyboard or other ways to get the target. mage attacking with stick, then use skill and attack with stick again looks, uhm, eye-catching and u easily can get mobbed.
another way to go would be to target the mob with normal attack, then stop running to it (press 'w' for example) and use skill to prevent getting mobbed and loose the range advantage of mages/priests, but i don't really know how to do it ^^ any suggestions? your help would be appreciated, and perhaps get the bot also suitable for mages :)

Edit: Tried some things and added one line in the find target function and now it works for me ^^

Code: Select all

function find_target()
  keyboardPress(key_attack);
  keyboardPress(key.VK_W);
end
also i deleted the lines:

Code: Select all

    if( attack_ready ) then
      keyboardPress(key_attack); attack_ready = false; yrest(1000); end;
in the fight function and now all's fine :)
Not the best way I think... but my priest can fight now :p
Thanks!

Next thing to do: Enable Auto-Aura-Of-Peacing ^^

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

Re: Shaiya bot

#190 Post by Administrator » Thu Mar 27, 2008 5:25 pm

It appears that the virtual key code for the ^ button on German keyboards is 220. You can edit the keymap.lua to set key.VK_TILDE to 220 if you wish, or simply use the constant 220 like so:

Code: Select all

  key_target =220;
  keyboardPress(key_target);
You could even pass 220 directly into keyboardPress(), but this is undesirable as it may be hard to remember what 220 is supposed to stand for.

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

Re: Shaiya bot

#191 Post by vvayinsane » Fri Apr 04, 2008 1:39 pm

UAC enabled ?

EliteXezotion
Posts: 1
Joined: Sat Apr 05, 2008 2:28 pm

Re: Shaiya bot

#192 Post by EliteXezotion » Sat Apr 05, 2008 2:51 pm

I have tried this and when I go to log in shaiya it says wrong client or somthing like that when Im trying to log in.

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

Re: Shaiya bot

#193 Post by Administrator » Sun Apr 06, 2008 3:38 am

After installing Shaiya, have you allowed it to update? If not, try letting it do so. If you already have, redownload the client, reinstall, and then apply the no-GG patch and launcher bypass right away.

If you know a thing or two about Olly and hexediting, you can use Olly to locate the call to CreateProcessA() that opens GameGuard. Set the InheritHandle to false (change the 6A 01 | PUSH 1 to 6A 00 | PUSH 0). That's basically it.

Solaris
Posts: 4
Joined: Sun Apr 06, 2008 3:26 pm

Re: Shaiya bot

#194 Post by Solaris » Sun Apr 06, 2008 8:08 pm

I am HUGE into this game Leveling has turned me off. I'd Like to run a bot Only when Im at work.

However.. I can't get it to work. I've read ALL 10 pages and nothing.

It works ONCE. Doesn't pick up items.. Doesn't Auto target enemies..
Help?

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

Re: Shaiya bot

#195 Post by Administrator » Sun Apr 06, 2008 9:56 pm

More information is needed. Have you installed the GameGuard patch, and used the loader? What is the output from MicroMacro? Post your log.txt.

Solaris
Posts: 4
Joined: Sun Apr 06, 2008 3:26 pm

Re: Shaiya bot

#196 Post by Solaris » Sun Apr 13, 2008 10:03 pm

ty for helping =]

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

Re: Shaiya bot

#197 Post by vvayinsane » Fri Apr 18, 2008 11:37 pm

Hey i made changes the the shaiya.lua script and gave it three changes to give Hp pots. The script worked and everything and i had to close downt he micro and the game so i can get things done for school. When i can back on shaiya and run the script again i get this message.

shaiya.lua:265 attemp to compare number with nil
stopping excution. It did 11,33,44,55 then it stops.

I check the log and this it what it tells me
Fri Apr 18 21:31:08 2008 : Executing script "shaiya.lua".
==================================================

Fri Apr 18 21:31:18 2008 : ...ner\Desktop\micromacro\micromacro\scripts\shaiya.lua:265: attempt to compare number with nil
stack traceback:
...ings\Owner\Desktop\micromacro\micromacro\lib\lib.lua:190: in function <...ings\Owner\Desktop\micromacro\micromacro\lib\lib.lua:126>
[C]: in function 'pcall'
...ings\Owner\Desktop\micromacro\micromacro\lib\lib.lua:236: in function 'startMacro'
...ner\Desktop\micromacro\micromacro\scripts\shaiya.lua:327: in main chunk

----------TRACEBACK END----------

Fri Apr 18 21:31:18 2008 : Execution of shaiya.lua complete.
Fri Apr 18 21:31:18 2008 : Execution success.
Fri Apr 18 21:31:18 2008 : Collecting garbage...
Fri Apr 18 21:31:18 2008 : GC closed process handle 0x58.
Fri Apr 18 21:31:18 2008 : 31KB freed.

This is the script its using

Code: Select all

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

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_hp1_potion = key.VK_9;
key_hp2_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(30);
skill2_time = secondsToTimer(30);
skill3_time = secondsToTimer(35);


------------------------------------------------
-- 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;
HP1_potion_use = 40;
HP2_potion_use = 30;


------------------------------------------------
-- 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 = 0;
MP_sit = 0;
SP_sit = 0;


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

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x02110AC8;

HP_offset = 296;
MaxHP_offset = 300;
MP_offset = 304;
MaxMP_offset = 308;
SP_offset = 312;
MaxSP_offset = 316;

targetid_addr = 0x00619B1C; -- short, 65535 if none selected
targettype_addr = 0x00619B1F; -- byte, 0 = player/NPC, 7 = monster

sitcheck_addr = 0x01FCFEE4; -- 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;

------------------------------------------------
-- 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_hp1_potion()
  keyboardPress(key_hp1_potion);
  printf("Using HP1 potion\n");
end

function use_hp2_potion()
  keyboardPress(key_hp2_potion);
  printf("Using HP2 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 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
      break;
    end

    if( HP < (lasthp - 10) ) then
      printf("Exiting rest...under attack\n");
      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()
  if( key_pickup == 0 ) then return; end

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

  yrest(1000);
end


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

  HP1 = memoryReadIntPtr(proc, playerptr_addr, HP_offset);
  MaxHP = memoryReadIntPtr(proc, playerptr_addr, MaxHP_offset);
  
  HP2 = 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);
  local readtype = memoryReadByte(proc, targettype_addr);

  return ( readid ~= 0xFFFF and readtype ~= 0 );
end

function find_target()
  keyboardPress(key_attack);
end



------------------------------------------------
-- FIGHT
------------------------------------------------
function fight()
  local attack_ready = true;

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

  local targetid = memoryReadByte(proc, targettype_addr);

  while( have_target() ) do
    if( targetid ~= memoryReadByte(proc, targettype_addr) ) then break; 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( (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
    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

  unregisterTimer("attack_timer");

  pickup()
end


------------------------------------------------
-- MAIN
------------------------------------------------
function main()
  proc = openProcess(findProcessByExe("game.exe"));
  win = findWindow("Shaiya");
  attach(win);
  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( (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
    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( (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

startMacro(main);

im new to the codeing and stuff but im learning....i dont get why this worked befor and not now.

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

Re: Shaiya bot

#198 Post by centik » Sat Apr 19, 2008 2:12 am

hi all..

im having a difficulty fixing my configeration..i cant get my other skills to work but my first attack skill(key 3) works fine ( actually it works too fine..trying to activate every 3 seconds or so ) but my other ones dont wanna activate (key 4 and 5)

heres my configiration..what did i do wrong? :cry: im preety sure i messed it up completely
------------------------------------------------
-- HOTKEYS
------------------------------------------------
printf("Shaiya bot v2\nPress INSERT key to start botting.\nYou may press DELETE to stop/pause.\n");
startKey = key.VK_INSERT;
stopKey = key.VK_DELETE;

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(3);
skill2_time = 1;
skill3_time = 1;


------------------------------------------------
-- 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 = 40;
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 = 30;
MP_sit = 20;
SP_sit = 10;


------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x02110AC8;

HP_offset = 296;
MaxHP_offset = 300;
MP_offset = 304;
MaxMP_offset = 308;
SP_offset = 312;
MaxSP_offset = 316;

targetid_addr = 0x00619B1C; -- short, 65535 if none selected
targettype_addr = 0x00619B1F; -- byte, 0 = player/NPC, 7 = monster

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




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

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

------------------------------------------------
-- 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);
HP = HP + 100;
printf("Using HP potion\n");
end


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


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


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

printf("Sitting.\n");

keyboardPress(key_sit);
yrest(500);

local lasthp = HP;

while( HP < MaxHP and MP < MaxMP and SP < MaxSP ) do
if( HP < lasthp ) then
printf("Exiting rest...under attack\n");
return;
else
lasthp = HP;
end

yrest(100);
end

local sitting = true;
while( sitting ) do
keyboardPress(key_sit);
yrest(500);

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


function pickup()
if( key_pickup == 0 ) then return; end

local i;
for i = 0, 5 do
keyboardPress(key_pickup);
yrest(200);
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);
local readtype = memoryReadByte(proc, targettype_addr);

return ( readid ~= 0xFFFF and readtype ~= 0 );
end

function find_target()
keyboardPress(key_attack);
end



------------------------------------------------
-- FIGHT
------------------------------------------------
function fight()
local attack_ready = true;

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

local targetid = memoryReadByte(proc, targettype_addr);

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

if( skill1_ready and skill1_time > 0 ) then
keyboardPress(key_skill1); skill1_ready = false; yrest(1000); end;
if( skill2_ready and skill2_time > 6) then
keyboardPress(key_skill2); skill2_ready = false; yrest(1000); end;
if( skill3_ready and skill3_time > 13) then
keyboardPress(key_skill3); skill3_ready = false; yrest(1000); 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

unregisterTimer("attack_timer");

pickup()
end


------------------------------------------------
-- MAIN
------------------------------------------------
function main()
proc = openProcess(findProcessByExe("game.exe"));
win = findWindow("Shaiya");
attach(win);
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();

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

startMacro(main);

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

Re: Shaiya bot

#199 Post by vvayinsane » Sat Apr 19, 2008 2:37 am

centik your problem is Really simple.

Look at your script and find where it says..


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

You see the first skill is set to go off every 3 secs.
secondsToTimer: How many secs you want befor it press the key
(3); Is actually how long you want it to wait.

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

So skill 1 will go off every 10 secs,
Skill 2 will go off everyone 15 secs.
Skill 3 will go off everyone 30 secs.

Hope that helped

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

Re: Shaiya bot

#200 Post by centik » Sat Apr 19, 2008 2:57 am

vvayinsane wrote:centik your problem is Really simple.

Look at your script and find where it says..


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

You see the first skill is set to go off every 3 secs.
secondsToTimer: How many secs you want befor it press the key
(3); Is actually how long you want it to wait.

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

So skill 1 will go off every 10 secs,
Skill 2 will go off everyone 15 secs.
Skill 3 will go off everyone 30 secs.

Hope that helped
tnak u very much sir..it works but i notice when the 3rd skill attack get activated it wont pick up nad the auto buffs dont work 5 and 10 minutes..dunno y..im just gonna use the 1st and 2nd skill attack..i think my sin can live with only 2 skill attack..tnx again :)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests