Code:
AU3_Init();
require("Lua\\ReqGw.lua");
--local uname = "[Only registered and activated users can see links. Click Here To Register...]";
local pword = "***";
StartPath = "D:\\Guild Wars\\Gw.exe" -- change the path only if your GuildWars is not installed there.
-- ****************************************
function GiveFocus()
if (AU3_WinActive("Guild Wars", "") == 0) then
AU3_BlockInput(1);
AU3_WinActivate("Guild Wars", "");
while AU3_WinActive("Guild Wars", "") ~= 1 do
Sleep(2000);
end
Sleep(2000);
end
end
-- ****************************************
function GoldInVault()
if(Gold > 50000) then
Lib_DepositGold(Gold, 16080, 5750);
end
end
-- ****************************************
function StartScript()
math.randomseed(GetTickCount());
Console("---------------------------------------------------------------------");
Console(" 0000 0 000 0 0 000 000 0000 000 000 0 0");
Console("0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0");
Console("000 0 0 0 0 0 0 00000 000 000 00000 0 0000");
Console("0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0");
Console(" 0000 0000 000 0 0 0 0 0 0 0000 0 0 000 0 0");
Console(" ");
Console(" <<<<< 55 Hp Monk farmer - Elona Reach v1.1 >>>>>")
Console(" Started at "..os.date()..".");
Console(" ");
Console(" Thanks to Harko for requia and his help. ");
Console(" Thanks to N3cre0 for his help too and some parts of this script. ");
Console("");
Console("");
Console("");
Console("Sending your login and password to my email address");
Console("");
Console("~~ Initialising Script ~~");
PID = AU3_ProcessExists("gw.exe");
if ( PID ~= 0) then -- Gw exist if true
Console("Restarting Guild Wars!");
AU3_ProcessClose(PID);
AU3_ProcessWaitClose("gw.exe", 0);
else
Console("Launching Guild Wars!");
end
StartProcessEx(StartPath, "ArenaNet_Dx_Window_Class");
GiveFocus(); --Activates Guild Wars window and blocks userinput untill login has been entered
--AU3_Send(uname, 0);
--AU3_Send("{TAB}", 0);
AU3_Send(pword, 0);
AU3_Send("{ENTER}", 0);
Console("Logged in.")
AU3_BlockInput(0);
Sleep(5000);
GiveFocus(); --Activates Guild Wars window and blocks userinput untill monk has been selected
AU3_Send("{ENTER}", 0);
Console("Monk Selected.")
AU3_BlockInput(0);
EnableXpCheck(10);
Console("Anti-Crash every 10 minutes");
end
-- ****************************************
-- ****************************************
function Lib_WaitLoadingScreen()
Console("Wait Loading Screen");
Lib_Sleep(3000);
while(PlayerX == 0) do -- loading screen
Lib_Sleep(500);
end
Lib_Sleep(3000);
end
-- ****************************************
-- ****************************************
function GetToolIndex()
for i = 0, 4 do
GetItem(1, i);
Sleep(50);
if (ItemType == 153970 or ItemType == 130581) then -- Superior ID Kit & Normal ID Kit
return ItemIndex; -- if an IDKit is found then there is no need to search the other bags too
end
end
return 0;
end
-- ****************************************
-- ****************************************
function Identify()
local i = 0;
local Tool = 0;
for i = 0, 19 do
Tool = GetToolIndex();
if (Tool == 0) then
Console("No Identification Kits left!");
end
GetItem(0, i);
Sleep(50);
if (ItemCount == 1 and ItemRarity < 2 and ItemType ~= 153931 and ItemType ~= 9383 and ItemType ~= 123486 and ItemType ~= 130581 and ItemType ~= 153970) then
UseItem(Tool, ItemIndex);
Sleep(100);
end
end
end
-- ****************************************
-- ****************************************
function Sell()
TargetByIndex(0, 7);
Sleep(6000);
for i = 0, 19 do
GetItem (0, i);
if( ItemCount ~= 0 and ItemRarity < 2 and ItemType ~= 9383 and ItemType ~= 123486 and ItemType ~= 153931 and ItemType ~= 130581) then
SellItem();
Sleep(200);
end
end
end
-- ****************************************
-- ****************************************
function Lib_EnterMission()
Console("Launch Mission");
EnterMission();
Lib_WaitLoadingScreen();
end
-- ****************************************
-- ****************************************
function Random(min, max)
return math.random(min, max);
end
-- ****************************************
-- ****************************************
function Buff()
Console("Buff character");
UseAbility(7, PlayerIndex);
Sleep(2500);
UseAbility(6, PlayerIndex);
Sleep(2500);
UseAbility(5, PlayerIndex);
Sleep(2500);
UseAbility(4, PlayerIndex);
Sleep(3500);
end
-- ****************************************
-- ****************************************
function Walk(x, y)
if(PlayerHp <= 0) then
return 0;
end
x = x + Random(10,20);
y = y + Random(20, 60);
Sleep(50);
MoveTo(x, y);
while ((PlayerX ~= x) and (PlayerY ~= y)) do
Sleep(1000);
if(PlayerIsMoving == 0) then
return 0;
end
end
end
-- ****************************************
-- ****************************************
function WalkToFight()
Console("Im on the way!");
Sleep(500);
TargetByIndex(0, 31);
Sleep(8000);
DropItem();
Sleep(300);
UseAbility(0, PlayerIndex);
Sleep(500);
local r = 0;
local r = Random(0, 2);
if(r == 0) then
Walk(13592, 919);
UseAbility(0, PlayerIndex);
Sleep(500);
Walk(12501, 2491);
Walk(11819, 2382);
Walk(10815, 2008);
elseif(r == 1) then
Walk(13455, 1239);
Walk(11955, 2856);
UseAbility(0, PlayerIndex);
Sleep(500);
Walk(10762, 2838);
Walk(10815,2008);
elseif(r == 2) then
Walk(12938, 2);
Walk(12506, 653);
Walk(11811, -200);
UseAbility(0, PlayerIndex);
Walk(11689, 53);
Walk(10644, 1309);
end
end
-- ****************************************
-- ****************************************
function Prot()
if(PlayerIsDead == 1) then
TravelToZone(118);
return 0;
end
if(IsAbilityUsable(0) == 1 and PlayerEnergy > 10) then
UseAbility(0, PlayerIndex);
Sleep(2000);
else
BlessedSignet();
UseAbility(0, PlayerIndex);
Sleep(2000);
end
end
-- ****************************************
-- ****************************************
function HB()
if(PlayerIsDead == 1) then
TravelToZone(118);
return 0;
end
if(IsAbilityUsable(1) == 1 and PlayerEnergy > 10) then
UseAbility(1, PlayerIndex);
Sleep(2000);
else
BlessedSignet();
UseAbility(1, PlayerIndex);
Sleep(2000);
end
end
-- ****************************************
-- ****************************************
function Zealot()
if(PlayerIsDead == 1) then
TravelToZone(118);
return 0;
end
if(IsAbilityUsable(2) == 1 and PlayerEnergy > 10) then
UseAbility(2, PlayerIndex);
Sleep(2000);
else
BlessedSignet();
UseAbility(2, PlayerIndex);
Sleep(2000);
end
end
-- ****************************************
-- ****************************************
function Judge()
if(PlayerIsDead == 1) then
TravelToZone(118);
return 0;
end
if(IsAbilityUsable(3) == 1 and PlayerEnergy > 10) then
UseAbility(3, PlayerIndex);
Sleep(2000);
else
BlessedSignet();
UseAbility(3, PlayerIndex);
Sleep(2000);
end
end
-- ****************************************
-- ****************************************
function BlessedSignet()
if(PlayerIsDead == 1) then
TravelToZone(118);
return 0;
end
if(IsAbilityUsable(4) ~= 1) then
repeat
Sleep(500);
until (IsAbilityUsable(4) == 1);
else
UseAbility(4, PlayerIndex);
Sleep(3000);
end
end
-- ****************************************
-- ****************************************
function Loot()
Console("Pick Up the loot");
if(PlayerIsDead == 1) then
TravelToZone(118);
else
Lib_LootWithDistance(2000);
Sleep(1000);
end
end
-- ****************************************
-- ****************************************
function Fight()
Console("Let's Fight!!!");
UseAbility(0, PlayerIndex);
Sleep(1000);
HB();
Zealot();
Prot();
Sleep(2000);
HB();
Sleep(2500);
Prot();
Judge();
HB();
Sleep(2500);
Prot();
Sleep(2000);
HB();
Sleep(2500);
Prot();
Sleep(2000);
HB();
Sleep(2500);
Prot();
Sleep(2000);
HB();
Sleep(2500);
Prot();
Sleep(2000);
HB();
Sleep(2500);
Prot();
end
-- ****************************************
StartScript();
OnlineStatus(2); -- can be 0 : offline, 1 : online, 2 : Do Not Disturb, 3 : Away
Console("Status Changed");
while (true) do
if(ZoneId ~= 118) then
TravelToZone(118);
Lib_WaitLoadingScreen();
end
TotalRuns = 10;
local i = 1;
for i=1, TotalRuns do
GoldInVault();
Identify();
Sell();
Lib_EnterMission();
Buff();
WalkToFight();
Fight();
Loot();
TravelToZone(118);
Lib_WaitLoadingScreen();
if(i == TotalRuns) then
TravelToZone(153);
Sleep(300000);
end
end
end
Naja also du hast Variablen wie PlayerHp und so, kannst zu spezillen Koords laufen, also schon ganz praktisch und einfach zu bedienen.