Const SpearID = 3277 Spell = 'Exeta con' MinMana = 600 MinSoul = 5 WeaponID = 3291
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;
While not terminated do begin UpdateWorld; if Self.Mana >= MinMana then if Self.Soul >= MinSoul then begin Spear := GetItemFromOpenBackpack(SpearID); if Spear <> nil then Spear.MoveToBody(Self.RightHand,1); Sleep(800); UpdateWorld; If Self.RightHand.ID = SpearID then Self.Say(Spell); UpdateWorld; Weapon := GetItemFromOpenBackpack(WeaponID); if Weapon <> nil then Weapon.MoveToBody(Self.RightHand,0); end; sleep(500);
|