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

#321 Post by Administrator » Sun Oct 12, 2008 5:45 pm

Offsets changed. Try these:

Code: Select all


------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x0081CBEC;

HP_offset = 0x12C; 
MaxHP_offset = 0x130;
MP_offset = 0x134;
MaxMP_offset = 0x138;
SP_offset = 0x13C;
MaxSP_offset = 0x140;

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

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

neon_shadow
Posts: 7
Joined: Sun Oct 12, 2008 5:15 pm

Re: Shaiya bot

#322 Post by neon_shadow » Sun Oct 12, 2008 6:11 pm

no luck, didn't work

i got this when i tried it

Code: Select all

MicroMacro v0.98
SolarImpact
http://solarimpact.servegame.com


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script> tryout.lua
Opening tryout.lua...

Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------
Shaiya bot v2
Press INSERT key to start botting.
You may press DELETE to stop/pause.
The macro is currently not running. Press the start key (Insert) to begin.
You may use (Delete) key to stop/pause the script.
Started.
...15thHour\Desktop\FF\MM\micromacro\scripts\tryout.lua:197: bad argument #2 to
'memoryReadByte' ((null))


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>







and this is what my lua file looks like

Code: Select all

------------------------------------------------
-- 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(30);
skill2_time = 0;
skill3_time = 0;


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

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


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


------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x0081CBEC;

HP_offset = 0x12C;
MaxHP_offset = 0x130;
MP_offset = 0x134;
MaxMP_offset = 0x138;
SP_offset = 0x13C;
MaxSP_offset = 0x140;

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

sitcheck_addr = 0x006DCC80; -- 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 > 0) then
      keyboardPress(key_skill2); skill2_ready = false; yrest(1000); end;
    if( skill3_ready and skill3_time > 0) 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);

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

Re: Shaiya bot

#323 Post by Administrator » Sun Oct 12, 2008 7:23 pm

Wrong script. This thread is not for Shaiya bot v2.

I believe you did not include some addresses that that script needed. Or, at least, had them wrongly named.
The error is coming from this line:

Code: Select all

  local readtype = memoryReadByte(proc, targettype_addr);
You should be able to work around this just by removing the readtype.

Code: Select all

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

  return ( readid ~= 0xFFFF );
end

neon_shadow
Posts: 7
Joined: Sun Oct 12, 2008 5:15 pm

Re: Shaiya bot

#324 Post by neon_shadow » Sun Oct 12, 2008 8:05 pm

You meant to take out all of this right?

Code: Select all

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

  return ( readid ~= 0xFFFF and readtype ~= 0 );
end
i did and the same message came up

i could have sworn i downloaded the shaiya.lua from the first page, but i guess ill check again


**EDIT**


OH NEVERMIND
I re-read what you said and I got that the second code was what i should be left with, not what i should remove. Ill try that out soon!

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

Re: Shaiya bot

#325 Post by Administrator » Sun Oct 12, 2008 8:07 pm

No, I mean modify that function to remove the readtype like I showed in my example. And if you removed that, it could not have given the same error.

neon_shadow
Posts: 7
Joined: Sun Oct 12, 2008 5:15 pm

Re: Shaiya bot

#326 Post by neon_shadow » Mon Oct 13, 2008 12:18 am

yeah i realized that right after i made that post, and i even edited it.

but i downloaded the shaiya.lua from the first page and tried to get that to work, but it doesnt. i know its doing some things, like attempting to use skills and such, but it doesnt automatically attack mobs and if it does, i automatically sit after the first attack please help me!
blaah here is my log

Code: Select all

Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script> gerirr1.lua
Opening gerirr1.lua...

Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------
The macro is currently not running. Press the start key (Insert) to begin.
You may use (Delete) key to stop/pause the script.
Started.
TARGETID: -1
Target lost.
Pickup!
Sitting.
Standing... Resuming bot
TARGETID: -52
Target lost.
Pickup!
Sitting.
Stopping execution.
and here is my lua

Code: Select all

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




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

key_switchtarget = key.VK_TILDE;

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

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

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

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

key_sit       = key.VK_C;


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


------------------------------------------------
-- BUFFS
------------------------------------------------
-- Set a buff to 0 if you don't want to use it
buff1_time = 0;
buff2_time = 0;

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


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


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

------------------------------------------------
-- Memory addresses
------------------------------------------------
playerptr_addr = 0x0081CBEC;

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

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

sitcheck_addr = 0x006DCC80; -- 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_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(3), attack_toggle); 

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

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

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

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

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

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

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

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

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

    yrest(100);
  end

  printf("Target lost.\n");

  unregisterTimer("attack_timer");

  pickup()
end


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

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

Re: Shaiya bot

#327 Post by Administrator » Mon Oct 13, 2008 2:16 am

Did you follow the instructions and set up your hotkeys correctly?

neon_shadow
Posts: 7
Joined: Sun Oct 12, 2008 5:15 pm

Re: Shaiya bot

#328 Post by neon_shadow » Mon Oct 13, 2008 9:27 am

Yeahyeah I did, but now something weird happened. It started to work pretty good this morning. The only thing i see wrong is that it sits after every battle, but that's not that big of a deal. If there is a way to correct this, I'd like to know, but otherwise, thanks for the help!

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

Re: Shaiya bot

#329 Post by Administrator » Mon Oct 13, 2008 6:18 pm

For how long does it sit? How much health (in percent) do you have? What have you configured the bot to sit at?

neon_shadow
Posts: 7
Joined: Sun Oct 12, 2008 5:15 pm

Re: Shaiya bot

#330 Post by neon_shadow » Mon Oct 13, 2008 9:16 pm

I have my bot to sit at 150hp only, with 0 values for sp and mp. I sit after everybattle, and i rarely lose more that 100 hp. I have 800 max. It sits untill I have full hp/sp/mp, and then stands up again. This isn't a very big problem though, so you don't have to worry about it :)

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

Re: Shaiya bot

#331 Post by Administrator » Mon Oct 13, 2008 11:15 pm

You're sitting because you have less than 150% HP. The variables you are supposed to set are by percent, not absolute values.

neon_shadow
Posts: 7
Joined: Sun Oct 12, 2008 5:15 pm

Re: Shaiya bot

#332 Post by neon_shadow » Tue Oct 14, 2008 9:36 pm

OH wow okay. Haha thanks, that wasn't very smart on my part.

ChaTWizzard
Posts: 18
Joined: Wed Jul 30, 2008 10:57 am

Re: Shaiya bot

#333 Post by ChaTWizzard » Sat Oct 18, 2008 4:35 am

Mine is still not targetting new monster....

Anyway i can change ingame key for the targetting or....

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

Re: Shaiya bot

#334 Post by Administrator » Sat Oct 18, 2008 5:10 am

Do you have your 1 hotkey set up for the attack button? If you manually press 1, does it target a new monster? How about the tilde (~)?

ChaTWizzard
Posts: 18
Joined: Wed Jul 30, 2008 10:57 am

Re: Shaiya bot

#335 Post by ChaTWizzard » Sat Oct 18, 2008 10:02 am

I am running the English UK keyboard and have a Qwerty keyboard... (english one) that might be the problem...

My "Tidle" key is not actually the key i use for selecting targets...
http://en.wikipedia.org/wiki/Image:KB_U ... ingdom.svg

My keyboard is different... If you can tell me how to open a file with the current script i can just get it so the following code instead of using "keyboardType" is something like openfile("C:/selecttarget.exe")

Then i can make myself an exe (already got one.. done what presses this key and closes)

Code: Select all

function switch_target()
keyboardType(key_switchtarget);
end

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

Re: Shaiya bot

#336 Post by Administrator » Sat Oct 18, 2008 12:26 pm

I'm guessing that VK_ACCENT would work for switching targets. But you would still need to have your normal attack hotkeyed to 1. I forgot how to bring up the skill tab that contains attack, but it's there somewhere. Just click and drag it into your hotkey bar.

I know it's strange, but the attack hotkey actually works better than the switch target hotkey for targetting. The switch target hotkey is only used when you are stuck/fighting a bugged monster.

ChaTWizzard
Posts: 18
Joined: Wed Jul 30, 2008 10:57 am

Re: Shaiya bot

#337 Post by ChaTWizzard » Sat Oct 18, 2008 5:07 pm

elverion wrote:I'm guessing that VK_ACCENT would work for switching targets. But you would still need to have your normal attack hotkeyed to 1. I forgot how to bring up the skill tab that contains attack, but it's there somewhere. Just click and drag it into your hotkey bar.

I know it's strange, but the attack hotkey actually works better than the switch target hotkey for targetting. The switch target hotkey is only used when you are stuck/fighting a bugged monster.

It might be working then... but my game does not select any enemies at start i have to manually do it..

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

Re: Shaiya bot

#338 Post by Administrator » Sat Oct 18, 2008 7:58 pm

So when you manually press 1, it targets a monster? Did you change your keyboard in config.lua? If you have, you shouldn't have, since en_us is the only one available at this time. Though, it shouldn't be too hard to make one for the UK.

I've attached a small tool I quickly slapped together to help in finding the correct scancodes. Just download and run scancode.exe, then press the tilde button on your keyboard. Don't use SHIFT or anything, just press #. It should give you the virtual key code for this button. What is it? If you plug that in to your keyboard layout for VK_TILDE, maybe it will work.

Do the same for the 1 key on your number row. What code did the attached program give you?

It might also be the accent button. Which should should still be 192, so I'm not sure why it wouldn't be working as-is.

ChaTWizzard
Posts: 18
Joined: Wed Jul 30, 2008 10:57 am

Re: Shaiya bot

#339 Post by ChaTWizzard » Sun Oct 19, 2008 8:01 am

I just input a new key......

VK_TARGET = 223


Now i use VK_TARGET it working fin

Dreadful_Warrior
Posts: 8
Joined: Wed Oct 01, 2008 3:08 am

Re: Shaiya bot

#340 Post by Dreadful_Warrior » Thu Oct 23, 2008 3:37 am

Hi Elverion,

Shaiya has updated again and the no GG patch no longer works, Hope you'll have the time soon on this ^_^, many thanks on your great work...

BTW if you have extra time, is it possible to add a script that will log off the character automatically when a [GM] or [GS] is on screen? gm and gs always has the [GM] and [GS] prefix before their name. thanks in advance...

More power on this developement, thanks...

BTW im no longer having problems with my script so far...
I dont use the sit script anymore i just stock up on pots, everyday i get 10m gold *sweet*

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests