Shaiya bot

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

Re: Shaiya bot

#21 Post by Administrator » Sun Jan 27, 2008 2:56 pm

The only problem now is that those are the old HP/MP/SP addresses. I would appreciate if somebody would find them, then lookup the pointers for me. I have posted a tutorial on how to find the pointers in the ArtMoney thread.

some206
Posts: 7
Joined: Sun Jan 27, 2008 3:36 pm

Re: Shaiya bot

#22 Post by some206 » Sun Jan 27, 2008 4:54 pm

elverion wrote:The only problem now is that those are the old HP/MP/SP addresses. I would appreciate if somebody would find them, then lookup the pointers for me. I have posted a tutorial on how to find the pointers in the ArtMoney thread.
i got them by follow the tut u posted
HP 0210A880+296

MP 0210A880+308

SP 0210A880+312


by the way i dident find the log.txt :|

JohnSmith

Re: Shaiya bot

#23 Post by JohnSmith » Sun Jan 27, 2008 6:56 pm

I am getting this error when running the script.

Image

JohnSmith

Re: Shaiya bot

#24 Post by JohnSmith » Sun Jan 27, 2008 6:58 pm

I have the GG fix and loader setup and i have edited the script to my charecters needs.

I will try changing the values that he has posted above me.

JohnSmith

Re: Shaiya bot

#25 Post by JohnSmith » Sun Jan 27, 2008 7:05 pm

Nope i still ge tthe same error after changing thoes calues.

any ideas on how to fix this?

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

Re: Shaiya bot

#26 Post by Administrator » Mon Jan 28, 2008 4:52 pm

some206 wrote:
elverion wrote:The only problem now is that those are the old HP/MP/SP addresses. I would appreciate if somebody would find them, then lookup the pointers for me. I have posted a tutorial on how to find the pointers in the ArtMoney thread.
i got them by follow the tut u posted
HP 0210A880+296

MP 0210A880+308

SP 0210A880+312


by the way i dident find the log.txt :|
Are you sure those addresses are correct? HP, max HP, MP, max MP, SP, and max SP should all be 4 bytes apart, in that order. So that means:
HP: 296
max HP: 300
MP: 304
max MP: 308
SP: 312
max SP: 316

Are you sure you didn't mix up max MP and MP?



JohnSmith: I will also need to see your log.txt. It will be in the same folder as micromacro.exe and will only appear after you have run it and got the error. I suspect that the problem is due to window name; ensure that the Shaiya window is still named "Shaiya" (it might have changed to something like "Shaiya - Open Beta", but and needs to be exact in the script).

JohnSmith

Re: Shaiya bot

#27 Post by JohnSmith » Mon Jan 28, 2008 5:52 pm

my Log

Code: Select all

Sun Jan 27 21:23:36 2008 : MicroMacro v0.96
Sun Jan 27 21:23:36 2008 : Processor Type: 586, OS: Windows XP Service Pack 2
Sun Jan 27 21:23:36 2008 : Lua initialized successfully.
Sun Jan 27 21:23:36 2008 : Lua libs opened successfully.
Sun Jan 27 21:23:36 2008 : Lua glues exported.
Sun Jan 27 21:23:36 2008 : Configurations run.
Sun Jan 27 21:23:43 2008 : Executing script "shaiya.lua".
==================================================

Sun Jan 27 21:25:59 2008 : findProcess() returned 0. Process not found or other error occured.
Sun Jan 27 21:25:59 2008 : Error attempting to open process 0x0. Error code: 87
Sun Jan 27 21:25:59 2008 : ...nts and Settings\josh\Desktop\micromacro\lib\lib.lua:105: Invalid data was supplied to getPixel().

Sun Jan 27 21:25:59 2008 : Execution of shaiya.lua complete.
Sun Jan 27 21:25:59 2008 : Execution success.
Sun Jan 27 21:25:59 2008 : Collecting garbage...
Sun Jan 27 21:25:59 2008 : GC closed process handle 0x0.
Sun Jan 27 21:25:59 2008 : 19KB freed.



I dont believe the name changed ether still says Shaiya on my task bar

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

Re: Shaiya bot

#28 Post by Administrator » Mon Jan 28, 2008 9:22 pm

Hmm, something seems messed up. The last time I tried updating the script, I might have attached the wrong copy or something. I have uploaded the fixed copy. Please redownload it, you can find it in my first post in this topic.

John smith

Re: Shaiya bot

#29 Post by John smith » Tue Jan 29, 2008 11:56 am

i am now getting the

invalid data was supplied to memoryreadintptr()

with your new script

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

Re: Shaiya bot

#30 Post by Administrator » Tue Jan 29, 2008 12:46 pm

Are you logged in with administrator priviliges? If not, you must run micromacro.exe with admin privileges.

Also, try changing this line:

Code: Select all

  proc = openProcess( findProcessByExe("Game.exe") );
To:

Code: Select all

  proc = openProcess( findProcess("Shaiya") );

John Smith

Re: Shaiya bot

#31 Post by John Smith » Tue Jan 29, 2008 2:32 pm

I am under an admin account

I also changed that line and I still get the same error.

My game window is called Shaiya so thats also not the issue.

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

Re: Shaiya bot

#32 Post by Administrator » Tue Jan 29, 2008 7:55 pm

Hmm, this is a really strange problem. It worked perfectly fine for me under the same OS and all. I did make some changes to find* functions to use EnumWindows instead (and also to allow for wildcards). I have just uploaded the latest update. Try the new copy and see if it works, but don't be too hopeful.

John Smith

Re: Shaiya bot

#33 Post by John Smith » Wed Jan 30, 2008 8:58 am

Same error again with the he new one.

when i hit f5 it auto selects my charecter and nothin happened i check macro and the error is there dunno if this helps but.


does it currently work for you?

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

Re: Shaiya bot

#34 Post by Administrator » Wed Jan 30, 2008 12:20 pm

Yes, it works just fine for me using 0.96 and this script:

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         = "0210A880";
HP_offset      = 296                 -- reported as 128; unconfirmed
HPmax_ptr      = "0210A880";
HPmax_offset   = 300;

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

SP_ptr         = "0210A880";
SP_offset      = 312;
SPmax_ptr      = "0210A880";
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    = 150;
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()
  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);
-------------------------------------------------
Are you sure GameGuard isn't running? If it is, it should display a little icon at the bottom right, near the system clock.

JohnSmith

Re: Shaiya bot

#35 Post by JohnSmith » Wed Jan 30, 2008 4:22 pm

omg wow i feel stupid i fogot to rename the cracked exe so it would run throught the loader it works fine now im sorry about this.
thank you so much

Jewbacca

Re: Shaiya bot

#36 Post by Jewbacca » Thu Jan 31, 2008 3:23 pm

Updated shaiya.lua can be found here

Credit to elverion for original creation ;)

Guest

Re: Shaiya bot

#37 Post by Guest » Sun Feb 03, 2008 9:56 pm

how can i get my bot to run? i have the crack cus i run cheat engine to speed hack and i dont have the log.txt




[imgw]http://img88.imageshack.us/img88/5879/91804440pt0.jpg[/imgw]
By some207 at 2008-02-03

some206
Posts: 7
Joined: Sun Jan 27, 2008 3:36 pm

Re: Shaiya bot

#38 Post by some206 » Sun Feb 03, 2008 10:12 pm

ugh i just notice something on my pitcture i have minnimacro v.65 and other people have micromacro where can i get the right one :x

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

Re: Shaiya bot

#39 Post by Administrator » Sun Feb 03, 2008 11:17 pm

Lol, wow. That's an old version you've got there. You can download 0.96 from the main site (http://solarimpact.servegame.com).

some206
Posts: 7
Joined: Sun Jan 27, 2008 3:36 pm

Re: Shaiya bot

#40 Post by some206 » Mon Feb 04, 2008 12:01 am

do i have to be a warrior or mage for the script to work becusa im a archer and all it dose is click my frist skill and stand there

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests