ScriptUO

Scripting Resources & Utilities => Stealth Client => Stealth scripts => Topic started by: dxrom on October 11, 2012, 11:43:09 AM

Title: [V4 , Pascal] [UO:R FS] dxrom's Lockpicking Trainer
Post by: dxrom on October 11, 2012, 11:43:09 AM
Another script I whipped up real quick, lock picking trainer.

NOTE: This does not yet have an option to refill picks as I am buying them when I need them. However it will not run when you are out of picks.

Code: [Select]
Program Lockpicking;

const
key = //ID of the key to relock the chest
chest = //ID of the lockable chest to pick
pick = $14FC;

var
ctime : TDateTime;

procedure lock;
begin
  ClearJournal;
  UseObject(key);
  WaitTargetObject(chest);
  WaitJournalLine(Now,'You lock it',1000);
  Wait(1000);
end;

begin
 While not Dead do
 begin
 While GetQuantity(FindTypeEx(pick,$FFFF,Backpack,false)) > 0 do
 begin
 UseType(pick,$FFFF);
 WaitForTarget(1000);
 if TargetPresent then
  begin
  ClearJournal;
  TargetToObject(chest);
  wait(500);
  end;
 WaitJournalLine(Now,'The lock quickly yields to your skill|You are unable to pick the lock',3000);
 wait(500);
 if (InJournalBetweenTimes('This does not appear to be locked|The lock quickly yields to your skill', ctime, Now)<>-1) then
  begin
  lock;
  end;
 end;
 end;
end.