Shaiya bot

For any other game that doesn't have its own section.
Message
Author
hpr12951
Posts: 29
Joined: Sat Feb 09, 2008 11:16 am

Re: Shaiya bot

#161 Post by hpr12951 » Wed Mar 12, 2008 4:20 am

The pick up is not working well. mm...

I started the script, after first attack , pick up is not working~ just find another monster to attack. (sometimes the pick up works again)

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

Re: Shaiya bot

#162 Post by Administrator » Wed Mar 12, 2008 4:49 am

What class are you? If it's a ranged class, it might not work too well. I guess it could also be a bug, but it seemed to be working fine for me earlier.

Kaioskontrol
Posts: 4
Joined: Wed Mar 12, 2008 10:12 am

Re: Shaiya bot

#163 Post by Kaioskontrol » Wed Mar 12, 2008 10:18 am

i ran the game and then the micromacro
i get continuous pages of this:
WARNING: Failure reading memory from 0x12458C0 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Only part of a ReadProcessMemory or WriteProcessMemory request was completed.)

also, after using the no GG version of game.exe, it says that the client version does not match

what should i do?

hpr12951
Posts: 29
Joined: Sat Feb 09, 2008 11:16 am

Re: Shaiya bot

#164 Post by hpr12951 » Wed Mar 12, 2008 10:59 am

Im a warrior.

The pick up is kind of strange~ dont know why.

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

Re: Shaiya bot

#165 Post by Administrator » Wed Mar 12, 2008 3:40 pm

Run the updater to get the newer version of Shaiya, then reinstall the no-GG patch.

Kaioskontrol
Posts: 4
Joined: Wed Mar 12, 2008 10:12 am

Re: Shaiya bot

#166 Post by Kaioskontrol » Thu Mar 13, 2008 8:59 am

thanks, that worked

but how do i edit shaiya.lua?

c0dedzer0
Posts: 4
Joined: Fri Mar 07, 2008 6:58 am

Re: Shaiya bot

#167 Post by c0dedzer0 » Thu Mar 13, 2008 12:50 pm

some things are a little buggy atm... don't know why but you guys should try and figure out why pickup does not work... observe your char, does it not pick up once in a while? any description would help the scrip maker to fix the bug... personally i was having those problems too... couple of things

- Pickup sometimes does NOT pickup
- Buffs sometimes are not executed

i did however got around all of these, by putting adding pickup on find_target () function, and switching some my skill key into my buff key that...
skills don't got a problem soo far... also i got a temporary solution to the stuck problem by making it switch target once every 500seconds, that way your char isn't stuck forever trying to get to a mob when there's an obstacle on the way...

as for the question above... open up Notepad and drag-drop the shaiya.lua file in there, or use open

Kaioskontrol
Posts: 4
Joined: Wed Mar 12, 2008 10:12 am

Re: Shaiya bot

#168 Post by Kaioskontrol » Thu Mar 13, 2008 3:31 pm

i still have quite a few problems

1: i dont want to use skills, and editing the script doesn't change anything
2: after the first kill, it does not seek out anymore targets
3: i cant pick up

i am an assassin

Kaioskontrol
Posts: 4
Joined: Wed Mar 12, 2008 10:12 am

Re: Shaiya bot

#169 Post by Kaioskontrol » Thu Mar 13, 2008 4:06 pm

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         = "210A880"; 
HP_offset      = 296; 
HPmax_ptr      = "210A880"; 
HPmax_offset   = 300; 

MP_ptr         = "210A880"; 
MP_offset      = 304; 
MPmax_ptr      = "210A880"; 
MPmax_offset   = 308; 

SP_ptr         = "210A880"; 
SP_offset      = 312; 
SPmax_ptr      = "210A880"; 
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    = 50; 
MP_usepotion    = 0; 
SP_usepotion    = 0; 

HP_sit          = 100; 
MP_sit          = 0; 
SP_sit          = 20; 

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

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

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(hdc, 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( findProcessByExe("Game.exe") ); 
  win = findWindow("Shaiya"); 
  hdc = openDC(win); 
  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 know whats wrong. i sit down every second and only use my first skill

can you make it so that i sit down at 100hp/0mp/0sp
also, i dont want to use any potions or skills

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

Re: Shaiya bot

#170 Post by Administrator » Thu Mar 13, 2008 11:32 pm

Use the new, fixed script. It is provided on the first page of this thread.

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

Re: Shaiya bot

#171 Post by vvayinsane » Fri Mar 21, 2008 9:12 pm

The bot works good. I made some of my own corrections like adding more spaces for buffs and skills. I found out in game you can make your self anouther quick toolbar that uses num keys. I dont know how i did it but its up. The only problem i have and i have yet to fix it on my own. Is that the HP, MP, SP does not work correctly. It will keep pressing and pressing and pressing and it will sit for a sec and get up. What could be the problem?

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

Re: Shaiya bot

#172 Post by Administrator » Sat Mar 22, 2008 8:38 am

Use a memory editor to check if 01FCFEE4 is 0 when standing, and 7 for sitting. If it isn't, then there could be your problem. Otherwise, check the sit() function and try to modify it to get it to work correctly.

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

Re: Shaiya bot

#173 Post by vvayinsane » Sat Mar 22, 2008 10:55 am

Shouldnt the script still work for me anyways. How come im haven trouble with it when most people have not.

Whats playerptr_addr?

Also whats
HP_offset =
MaxHP_offset =

I dont understand what they actually mean...
I have artmoney. I was able to find my HP,MP.SP but that isnt what i need for the script?

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

Re: Shaiya bot

#174 Post by Administrator » Sat Mar 22, 2008 12:08 pm

Shouldnt the script still work for me anyways. How come im haven trouble with it when most people have not.
It could be due to timing or latency, which are variable.
Whats playerptr_addr?
A pointer to the address of the player's pawn.
HP_offset =
MaxHP_offset =
The offset of HP/max HP from the player's pointer.


0x02110AC8 points to (for example) 0x12345678. 0x12345678 + 296 resolves to 0x123457A0, so 0x123457A0 contains the players HP. Large amounts of data in games today are stored in dynamic addresses, not static ones (though, the pointers are static), therefor a pointer is needed to access the same data.

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

Re: Shaiya bot

#175 Post by vvayinsane » Sun Mar 23, 2008 2:47 am

Well with the script that said was updated everything on it works just fine execpt healing. heres what i think is causeing the problem for me anyways

-- Memory addresses
------------------------------------------------
playerptr_addr = ;

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


When i site and stand i get 2 different things pop up for 0 and 7 so wouldnt that cause my problem?

I dont know actually how to get the 0x0 numbers. I am able to get the other numbers.

I want to get the heal working so i dont die..lol
------------------------------------------------

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

Re: Shaiya bot

#176 Post by Administrator » Sun Mar 23, 2008 8:19 am

You removed the playerptr_addr, therefor, the script cannot read your character's HP. If it does not know your HP, it cannot tell when to heal.
When i site and stand i get 2 different things pop up for 0 and 7 so wouldnt that cause my problem?
Can you repeat that? When you are moving between sitting and standing, it may be between 0 and 7. That is because this number is the keyframe your character is currently at. So while you are getting up, you may see a 5 flash by real quick.
I dont know actually how to get the 0x0 numbers. I am able to get the other numbers.
That's hexadecimal (base 16) notation. You can use decimal if you prefer. Just do not put a 0x in front of it.

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

Re: Shaiya bot

#177 Post by vvayinsane » Sun Mar 23, 2008 5:19 pm

well, the playerptr_addr was there. I wasnt working. so i thought i found the right playerptr_addr for myself but i relised i wasnt doing it right so i just left i blank. Second i used artmoney and this is what i found for 0 and 7 for sitting and standing. i come up with two address

Address 045DE520 value 7 integer 4 bytes
Address 045DE5E4 Value 7 integer 4

I filltered like 4 more times and i still get these two.


Also is there a way to change the script so it just use the hp, mp,sp, instead of what it is useing cause i dont know how to get that with artmoney if anyone knows how i would like to know and see if i get the same numbers

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

Re: Shaiya bot

#178 Post by Administrator » Sun Mar 23, 2008 7:58 pm

If you can locate your HP/MP/SP in Artmoney, use this tutorial to find playerptr_addr: http://solarimpact.servegame.com/phpBB3 ... p?f=5&t=10

It's really just that simple. The resulting pointer will be the player's pointer + HP offset (for example). You can then update playerptr_addr and the offsets(though they probably will not have changed). If you get 300 for your HP offset (again, this is an example), then you can just put HP_offset = 300.
Address 045DE520 value 7 integer 4 bytes
Address 045DE5E4 Value 7 integer 4
It's likely that these are both valid. Try putting either one of them into the sitcheck_addr (or whatever it is), and see if that works.

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

Re: Shaiya bot

#179 Post by vvayinsane » Sun Mar 23, 2008 10:15 pm

Some reason i get 2 of everything here is what i got for my hp

02110AC8 +269
00110A10 +136

Why am i the only one haven problems with the scripts..lol..whats different on my computer then everyone elses

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

Re: Shaiya bot

#180 Post by Administrator » Mon Mar 24, 2008 8:45 am

Some reason i get 2 of everything here is what i got for my hp

02110AC8 +269
00110A10 +136
That's normal. Sometimes, a game may have multiple pointers to the same information. In this case, I can tell you (from experience with Shaiya) that the first one is going to be the address you'll want to use. Change playerptr_addr to 0x02110AC8, and HP_offset to 269. But, I think you actually meant +296? This means that all of the addresses and offsets were correct.
Why am i the only one haven problems with the scripts..lol..whats different on my computer then everyone elses
I'm not really sure what originally was wrong. Did the bug only occur when trying to sit, and it would continue sitting and standing? If so, then correcting the sitcheck_addr should have fixed this.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests