Shaiya bot

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

Re: Shaiya bot

#221 Post by Administrator » Thu May 29, 2008 3:00 am

At the beginning of your attack() function, you could do something like this:

Code: Select all

local beginTime = os.time();
Now, in the loop of your attack() function (while(..) do ... end), you could do this:

Code: Select all

  local currentTime = os.time();
  if( os.difftime(currentTime, beginTime) > 30 ) -- 30 seconds has elapsed...
    return; -- get out of this function!
  end
This is the simplest way to do it.

Raymo69
Posts: 1
Joined: Sat May 31, 2008 2:24 am

Re: Shaiya bot

#222 Post by Raymo69 » Sat May 31, 2008 2:25 am

ok so let me ask.... how do i get it to auto atk mmonsters? i ran the program and script but it doesnt auto atk

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

Re: Shaiya bot

#223 Post by Administrator » Sat May 31, 2008 4:03 am

Reading and following the instructions on the first page without skipping a single step is a good start. You must not have done one of the following:
  • Install the GameGuard patch
    Set your hotkeys (in script and in game)
    Installed and ran the script properly
If you had posted your log.txt, it would be much easier to tell where you went wrong.

Dnic
Posts: 24
Joined: Sun Jun 01, 2008 4:03 pm

Re: Shaiya bot

#224 Post by Dnic » Sun Jun 01, 2008 4:06 pm

First let me say what an awesome job, really appreciate it.

I had no problem with the scrip from the get go. Not a programmer, but fairly easy to understand.

I did what c0dedzer0 did with the MP/SP so that it doesn't pot. My question is currently it takes HP pot from slow 8. How can I add more slots for HP. Like if I want to use slot 9 and 0 to add more pots.

Also sometimes you have NPC's that are "stuck". I thought I read that the script will search for another target if the NPC's HP doesn't go down. It doesnt seem to use the "~" key ever.

Thanks a lot.

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

Re: Shaiya bot

#225 Post by Administrator » Sun Jun 01, 2008 5:57 pm

The newest version of the script, updated on the 29th, will cycle to a different target after 1 minute if the target has not died. You'll find the code for this in the fight() function.

As for using different slots for Hp/Mp potions, you can just use a conditional within the use functions. Something like this:

Code: Select all

__hp_use_count = 0;
function use_hp_potion()
  if( __hp_use_count < 10 ) then
    keyboardPress(key.VK_whatever);
  else
    keyboardPress(key.VK_whatever2);
  end

  __hp_use_count = __hp_use_count + 1;
end

Dnic
Posts: 24
Joined: Sun Jun 01, 2008 4:03 pm

Re: Shaiya bot

#226 Post by Dnic » Sun Jun 01, 2008 6:42 pm

Thank you, works great. Haven't tested the stuck NPC part yet.

Dnic
Posts: 24
Joined: Sun Jun 01, 2008 4:03 pm

Re: Shaiya bot

#227 Post by Dnic » Tue Jun 03, 2008 11:06 pm

Well the code you gave me was working but some reason now its only taking from the 9th slot. I'm gonna start with a fresh copy of the script and try it again.

Also it still doesn't break off of stuck NPC's. It just sits there and doesn't attempt to move on to the next target. This is also true if your guy gets stuck behind a tree or any other obstacle.

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

Re: Shaiya bot

#228 Post by Administrator » Wed Jun 04, 2008 2:22 am

Yes, start with a fresh copy of the script. It should work fine as long as there is an enemy to switch to within reasonable range.

Dnic
Posts: 24
Joined: Sun Jun 01, 2008 4:03 pm

Re: Shaiya bot

#229 Post by Dnic » Wed Jun 04, 2008 7:39 am

Ok started a fresh copy and here is what I found. If your guy gets stuck behind something trying to attack an NPC (as its running behind that object the entire time) the script will go to target lost and pickup (your guy is still running against object). However instead of acquiring a different target it acquires the same one again.

Also for dead (stuck) NPC's their healthbar is empty and it does not change off of that one.

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

Re: Shaiya bot

#230 Post by Administrator » Wed Jun 04, 2008 8:16 pm

Alright, thanks for the info. I'll look into it when I get some time.

RawR
Posts: 4
Joined: Tue Jun 03, 2008 5:09 pm

Re: Shaiya bot

#231 Post by RawR » Sun Jun 08, 2008 9:18 pm

elverion : Is there going to be a script release that has the anti ks-ing already put in, and also the character/npc stuck change over target implemented and the like, i tried many characters with the fresh scripts etc with keys etc set, and it wouldn't buff on time, wouldn't use the 3 skills that were at its disposal everytime they came off cooldown, and im at a loss as i have never in my life scripted and it all looks like mumbo jumbo to me :/

Regards,
RawR :)

shaiya obsession ... worse than car imports xD

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

Re: Shaiya bot

#232 Post by Administrator » Mon Jun 09, 2008 1:27 am

I'll consider it. Are you sure the time wasn't a time issue? I mean, did you set the time for the skills correctly? If you can, copy/paste the code segment. Also let me know what the cooldowns for your skills are, too.

caccolone
Posts: 24
Joined: Mon Jun 09, 2008 8:23 am
Location: Frankfurt - Germany

Re: Shaiya bot

#233 Post by caccolone » Mon Jun 09, 2008 8:36 am

hi all,
Im new on this nice forum, first of all thanks for the good job with micromacro, after that I post here for one problem.
My micromacro was working fine before and after EP3 , I still use my old and poor lua but it work exept pick up * dont know why * now I have downloaded your new version of the script added the setting for my char without change nothing of your work ( just added 2 more buff ).
When I start the micromacro it dont show me error , so I enter in game and after I press ( F5 ) start my guy kill 1 mobs and stop, nothing more happen, im going to check micromacro and find a error.
Why your script dont run? I post it here so you can look it and maybe help me out :)
Last question, this make me crazy, on the key for switch target you type * TILDE * well it never work for me, I mean and ask, exectly wich simbol got this * tilde * key ? my keyboard is italian version but i have try with US keyboard from windows and nothing change, in italian version I got this simbol ( \ ) and in US version this ( ` ) can you tell me the name of simbols?

thanks in advance

my lua :

Code: Select all

------------------------------------------------
-- HOTKEYS
------------------------------------------------
startKey = key.VK_F5;
stopKey = key.VK_F6;

key_switchtarget = key.VK_TILDE;

key_attack  = key.VK_1;
key_pickup  = key.VK_9;

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

key_buff1   = key.VK_NUMPAD1;
key_buff2   = key.VK_NUMPAD2;
key_buff3   = key.VK_NUMPAD3;
key_buff4   = key.VK_NUMPAD4;

key_hp_potion = key.VK_NUMPAD8;
key_mp_potion = key.VK_NUMPAD9;
key_sp_potion = key.VK_NUMPAD0;

key_sit       = key.VK_C;


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


------------------------------------------------
-- BUFFS
------------------------------------------------
-- Set a buff to 0 if you don't want to use it
buff1_time = minutesToTimer(2);
buff1_time = minutesToTimer(3);
buff1_time = minutesToTimer(4);
buff2_time = minutesToTimer(8);

------------------------------------------------
-- POTIONS
------------------------------------------------
-- All potion use values are specified in %
-- Set the values to 0 to not use that potion
HP_potion_use = 60;
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 = 0;
MP_sit = 0;
SP_sit = 0;


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

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x007835B4;

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

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

sitcheck_addr = 0x00643648; -- 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;
buff3_ready = true;
buff4_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;
buff3_toggle = function () buff3_ready = true; end;
buff4_toggle = function () buff4_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 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");
      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(10), 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) > 30 ) then -- more than 30 seconds has passed
      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(10000); 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;
    if( buff3_ready  and buff3_time > 0 ) then
      keyboardPress(key_buff3); buff3_ready = false; yrest(2000); end;
    if( buff4_ready  and buff4_time > 0 ) then
      keyboardPress(key_buff4); buff4_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");
  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;
  if( buff3_time ) then registerTimer("buff3_toggle", buff3_time, buff3_toggle); end;
  if( buff4_time ) then registerTimer("buff4_toggle", buff4_time, buff4_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( buff3_ready  and buff3_time > 0 ) then
      keyboardPress(key_buff3); buff3_ready = false; yrest(2000); end;
    if( buff4_ready  and buff4_time > 0 ) then
      keyboardPress(key_buff4); buff4_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);

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

Re: Shaiya bot

#234 Post by centik » Mon Jun 09, 2008 11:11 am

@caccolone

u need the new game.exe provided on the first page of this thread

caccolone
Posts: 24
Joined: Mon Jun 09, 2008 8:23 am
Location: Frankfurt - Germany

Re: Shaiya bot

#235 Post by caccolone » Mon Jun 09, 2008 11:56 am

hi Centik,
I have a new game :) with my old lua it work but i dont have some function, I have try with the new basic lua of Elv and it dont work

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

Re: Shaiya bot

#236 Post by Administrator » Mon Jun 09, 2008 6:02 pm

Use code tags next time. It's not hard, I promise.

[code]
paste your code here
[/code]

You haven't told us if you have gotten the newest version of the no GG patch. More information is needed before anyone can help you. Try posting your log.txt.

caccolone
Posts: 24
Joined: Mon Jun 09, 2008 8:23 am
Location: Frankfurt - Germany

Re: Shaiya bot

#237 Post by caccolone » Tue Jun 10, 2008 2:52 am

elverion wrote:Use code tags next time. It's not hard, I promise.

Code: Select all

paste your code here
You haven't told us if you have gotten the newest version of the no GG patch. More information is needed before anyone can help you. Try posting your log.txt.
Hi Elv,
sorry next time I post with code :) yes I have download the new GG from here because after EP3 micromacro old version dont work, with new GG work and with my lua , old lua it work again, after that I have download the new LUA from here and setting it for my char but after first kill it stop

my los is this :

Code: Select all

Tue Jun 10 01:25:20 2008 : MicroMacro v0.97
Tue Jun 10 01:25:20 2008 : Processor Type: 586, OS: Windows XP Service Pack 2
Tue Jun 10 01:25:20 2008 : Lua initialized successfully.
Tue Jun 10 01:25:20 2008 : Lua libs opened successfully.
Tue Jun 10 01:25:20 2008 : Lua glues exported.
Tue Jun 10 01:25:20 2008 : Keyboard layout: US English
Tue Jun 10 01:25:20 2008 : Configurations run.
Tue Jun 10 01:25:25 2008 : Executing script "shaiya.lua".
==================================================

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:29 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:30 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)

Tue Jun 10 01:25:31 2008 : WARNING: Failure reading memory from 0xA8FD30 at 0x2110ac8 in memoryReadIntPtr(). Error code 299 (Richiesta ReadProcessMemory o WriteProcessMemory completata solo parzialmente.)
this is only one part of log, the message was same in any string, I have try out the US keyboard and UK keyboard to but nothing change

thanks

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

Re: Shaiya bot

#238 Post by Administrator » Tue Jun 10, 2008 4:03 am

That looks like the old addresses to me. Are you sure you installed the newest version of the script properly?

caccolone
Posts: 24
Joined: Mon Jun 09, 2008 8:23 am
Location: Frankfurt - Germany

Re: Shaiya bot

#239 Post by caccolone » Tue Jun 10, 2008 6:42 am

elverion wrote:That looks like the old addresses to me. Are you sure you installed the newest version of the script properly?
dam your right, yes I have download the new script and new GG but this log is my old, it work but say me error in micromacro, what I want solve is the problem with new LUA, now I run micromacro with it and I post here the log.

Code: Select all

Tue Jun 10 13:37:02 2008 : MicroMacro v0.97
Tue Jun 10 13:37:02 2008 : Processor Type: 586, OS: Windows XP Service Pack 2
Tue Jun 10 13:37:02 2008 : Lua initialized successfully.
Tue Jun 10 13:37:02 2008 : Lua libs opened successfully.
Tue Jun 10 13:37:02 2008 : Lua glues exported.
Tue Jun 10 13:37:02 2008 : Keyboard layout: US English
Tue Jun 10 13:37:02 2008 : Configurations run.
Tue Jun 10 13:37:12 2008 : Executing script "Test.lua".
==================================================

Tue Jun 10 13:38:53 2008 : ...a programmi\SHAIYA MACRO\micromacro\scripts\Test.lua:276: attempt to compare number with nil
Tue Jun 10 13:38:53 2008 : Execution of Test.lua complete.
Tue Jun 10 13:38:53 2008 : Execution error: Runtime error
Tue Jun 10 13:38:53 2008 : Collecting garbage...
Tue Jun 10 13:38:53 2008 : 5KB freed.
when I press F5 my guy start, doing 2 buffs not 4 and kill 1 mob, after that nothing more happen

my LUA :

Code: Select all

------------------------------------------------
-- HOTKEYS
------------------------------------------------
startKey = key.VK_F5;
stopKey = key.VK_F6;

key_switchtarget = key.VK_TILDE;

key_attack  = key.VK_1;
key_pickup  = key.VK_9;

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

key_buff1   = key.VK_NUMPAD1;
key_buff2   = key.VK_NUMPAD2;
key_buff3   = key.VK_NUMPAD3;
key_buff4   = key.VK_NUMPAD4;

key_hp_potion = key.VK_NUMPAD8;
key_mp_potion = key.VK_NUMPAD9;
key_sp_potion = key.VK_NUMPAD0;

key_sit       = key.VK_C;


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


------------------------------------------------
-- BUFFS
------------------------------------------------
-- Set a buff to 0 if you don't want to use it
buff1_time = minutesToTimer(2);
buff1_time = minutesToTimer(3);
buff1_time = minutesToTimer(4);
buff2_time = minutesToTimer(8);

------------------------------------------------
-- POTIONS
------------------------------------------------
-- All potion use values are specified in %
-- Set the values to 0 to not use that potion
HP_potion_use = 60;
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 = 0;
MP_sit = 0;
SP_sit = 0;


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

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x007835B4;

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

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

sitcheck_addr = 0x00643648; -- 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;
buff3_ready = true;
buff4_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;
buff3_toggle = function () buff3_ready = true; end;
buff4_toggle = function () buff4_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 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");
      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(10), 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) > 30 ) then -- more than 30 seconds has passed
      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(10000); 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;
    if( buff3_ready  and buff3_time > 0 ) then
      keyboardPress(key_buff3); buff3_ready = false; yrest(2000); end;
    if( buff4_ready  and buff4_time > 0 ) then
      keyboardPress(key_buff4); buff4_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");
  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;
  if( buff3_time ) then registerTimer("buff3_toggle", buff3_time, buff3_toggle); end;
  if( buff4_time ) then registerTimer("buff4_toggle", buff4_time, buff4_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( buff3_ready  and buff3_time > 0 ) then
      keyboardPress(key_buff3); buff3_ready = false; yrest(2000); end;
    if( buff4_ready  and buff4_time > 0 ) then
      keyboardPress(key_buff4); buff4_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);

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

Re: Shaiya bot

#240 Post by Administrator » Tue Jun 10, 2008 5:00 pm

That error basically means you're using an undeclared or undefined variable at that line number. I've inspected the code, and have found your problem. The script expects buffx_time where x is 1-4.
-- Set a buff to 0 if you don't want to use it
buff1_time = minutesToTimer(2);
buff1_time = minutesToTimer(3);
buff1_time = minutesToTimer(4);
buff2_time = minutesToTimer(8);
You've got buff1_time reassigned twice, buff2_time assigned once, and buff3_time and buff4_time absent.
buff1_time = minutesToTimer(2);
buff2_time = minutesToTimer(3);
buff3_time = minutesToTimer(4);
buff4_time = minutesToTimer(8);
Would be the correct way to do it.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests