Michalekk
Senior User
- Joined
- Aug 3, 2008
- Messages
- 752
- Reaction score
- 163
- Age
- 30
Odp: Du?y zbi?r skrypt?w do NG.
Mam Pro?b? Czy Mogli By?cie Da? skrypt na zamian? soft?w na bohy je?eli mam xxx many a nie xxx hp z gory dzi?kuje
OPIS:
Min_mana - przy jakim PROCENCIE many ma wrzucac
max_mana - przy jakim PROCENCIE ma zdejmowac
KOMENDY:
Message - komenda na sprawdzenie ZDALNIE ile zostalo softow(dziala poprawnie po wpisaniu drugiej komendy)
GMessage - komenda ktora pobiera najswiezsze informacje ile pozostalo softow
Code:
Const
// Boots to use if LESS then Min_Health //
Min_Mana = 65 //in %
SoftBoots_ID = 6529
SoftBoots_InUse_ID = 3549
// Boots to use if you have MORE then Max_Health //
Max_Mana = 95 //in %
Boh_ID = 3552 // BoH - 3079, Pirate Boots - 5461
Mesage = 'check softboots'
GMessage = 'update data'
AlertFrom = 'C:/Windows/Media/Notify.wav'
Logout = 0
Var
Pause, B: Boolean
SBS,BOO: integer;
SBAmount: string;
Procedure Event_KeyUp(Key: integer);
begin
if Key = $13 then Pause := not Pause;
end;
procedure Event_Message(Channel: integer; Name, Text: String);
begin
updateworld;
if Text = GMessage then
begin
B:=True;
end;
if Text = Mesage then
begin
self.PrivateMessage(Name, 'Soft boots has energy for '+SBS+'.');
end;
end;
procedure Event_Notice(Text: string);
begin
updateworld;
if (pos('You see a pair of soft boots (faster regeneration)', Text) <> 0) then
begin
SBAmount:= Text;
Delete(SBAmount, 1, 71);
SBAmount:=Copy(SBAmount, 1, Pos(' l', SBAmount));
end;
if (pos('You see a pair of soft boots that', Text) <> 0) then
begin
SBAmount:= Text;
Delete(SBAmount, 1, 49);
SBAmount:=Copy(SBAmount, 1, Pos(' l', SBAmount));
end;
if (pos('You see a pair of worn', Text) <> 0) then
begin
SBAmount:= 'You are out of soft boots.';
end;
end;
function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;
begin
Pause := False;
B:=False;
while not terminated do
begin
processevents;
if not pause then
begin
UpdateWorld;
SBS:=SBAmount;
if B then
begin
updateworld;
Self.Containers.Container[0].Item[0].Look;
sleep(100);
Self.Feet.Look;
B:=False;
end;
if Self.Mana <= Min_Mana/100*Self.MaximumMana then
begin
if Self.Feet.ID <> SoftBoots_InUse_ID then
begin
Boots := GetItemFromOpenBackpack(SoftBoots_ID);
if Boots <> nil then
Boots.MoveToBody(Self.Feet,0);
else Self.Displaytext('Boots werent found in open backpack!');
end;
end;
if Self.Mana >= Max_Mana/100*Self.MaximumMana then
begin
if Self.Feet.ID <> Boh_ID then
begin
Boots := GetItemFromOpenBackpack(Boh_ID);
if Boots <> nil then
Boots.MoveToBody(Self.Feet,0);
else Self.Displaytext('Boots werent found in open backpack!');
end;
end;
end;
if ((Self.Feet.ID <> BOH_ID) and (Self.Feet.ID <> SoftBoots_InUse_ID)) then
begin
PlaySound(AlertFrom);
if Logout = 1 then Self.Logout(False);
if Logout = 2 Then Self.Logout(True);
end;
Sleep(4000);
end;
end;