I found this script off these forum...but since i can't understand much out of it, can someone tell me how i can modify it so that it also adds dragging and dropping of pills from inventory to hotbar...Quote:
procedure SetUpScript;
begin
ClearDeBug;
ActivateClient;
end;
const Health = 4337886; // Health bar color
const Chi = 14560330; // Chi bar color
const MapLoad = 0; // Color to look for when new map is loading
const Died = 0; // Color to look for in Health bar when dead
const HPPill = '1'; // Key to eat HP Pill
const ChiPill = '2'; // Key to eat Chi Pill
var hc: Integer;
function HealthCheck: Integer;
var X, Y: Integer;
var HP_Result: Boolean; // Return true/ false depending on if HP bar color is seen
var MP_Result: Boolean; // Return true/ false depending on if Chi bar color is seen
var CheckMapLoad: Boolean; // Return true/ false depending on if a new map is loading
var Dead: Boolean; // Return true/ false depending on if it determines you died
begin
Wait(100); // Wait 100 ms for screen to refresh, otherwise it will use 2 pills at a time
CheckMapLoad := FindColor(X, Y, MapLoad, 38, 4, 38, 4); // Check to see if new map is loading
if (CheckMapLoad = true) then
begin // If a new map is loading, wait 10 seconds for the map to load before continuing
WriteLn('Waiting for map to load...');
Wait(10000);
WriteLn('Ready');
end;
if (CheckMapLoad = false) then // If a new map is not loading, continue...
begin
Dead := Findcolor(X, Y, Died, 57, 12, 57, 12); // Check to see if your character died
if (Dead = true) then
begin // Wait for respawn before continuing
WriteLn('Fuck, you died!');
Wait(1000);
WriteLn('Waiting for respawn...');
Wait(11000);
WriteLn('Ready');
Wait(9000 + Random(1000));
end;
if (Dead = false) then // If a new map is not loading and your character is not dead, start checking HP and Chi
begin
HP_Result := FindColor(X, Y, Health, 135, 0, 200, 40); // Find out if HP is good
if (HP_Result = false) then
begin
Result := 1; // If HP color is not found, return 1
end;
if (HP_Result = true) then // As long as HP is OK, check Chi
begin
MP_Result := FindColor(X, Y, Chi, 100, 0, 200, 40); // Find out if Chi is good
if (MP_Result = false) then
begin
Result := 2; // If Chi color is not found, return 2
end;
end;
end;
end;
end;
begin
SetUpScript;
while (True) do
begin
hc := 0; // Make hc default to 0
hc := HealthCheck; // hc is set to 0, 1 or 2 depending on what HealthCheck returned
if (hc = 1) then // If HealthCheck didn't see Health bar color and returned 1, press HP key
begin
Wait(50 + Random(20));
KeyDown(GetKeyCode(HPPill)); // Press key specified for HP pill
Wait(100 + Random(100)); // Adds a random interval before release
KeyUp(GetKeyCode(HPPill)); // Release key after 100-200 ms
//WriteLn('Took HP Pill'); // Writes this in debugger window if uncommented
end;
if (hc = 2) then // If HealthCheck didn't see Chi bar color and returned 2, press Chi key
begin
Wait(50 + Random(20));
KeyDown(GetKeyCode(ChiPill)); // Press key specified for Chi pill
Wait(100 + Random(100)); // Adds a random interval before release
KeyUp(GetKeyCode(ChiPill)); // Release key after 100-200 ms
//WriteLn('Took Chi Pill'); // Writes this in debugger window if uncommented
end;
end;
end.