ScriptUO

Scripting Resources & Utilities => Orion UO Client => Topic started by: roro4ever on September 04, 2023, 10:53:46 PM

Title: Orion.GetLastGump or GetGump() not suit for 1.26.4 client?
Post by: roro4ever on September 04, 2023, 10:53:46 PM
Hello, I am a newbie for OrionUO Script. The freeshard I played recently using 1.26.4 client. I wrote some scirpt for train skill, and there are no problem.
Few days ago, I downloaded a script for trian blacksmithy skill, but it stucked at some code about gump.
So I wrote some scripts for  learn and test gump statements.

But I found  some problem, first is :  How can I get gumpobject?
For example.
Code: [Select]
function test(){
var IngotType='0x1BEF';
var gump0,gump1,gump2;
  //TextWindow.Open();
  Orion.UseType(IngotType);
  Orion.Wait('useitemdelay'); 
  gump0=Orion.GetLastGump();
  gump1=Orion.GetGump('last');
  Orion.Print('Orion.GumpCount='+Orion.GumpCount); 
  if (!(gump0 == null)) {
  Orion.Print(gump0.ID);
  Orion.InfoGump();
  Orion.Wait(500);
  }   
  else Orion.Print('No get gump0');
  if (gump1==null) Orion.Print('gump1 is null');
}

The result is :

gump0 and gump1 all are null....

why? 1.26.4 or other low version Clients can't GetGump?
Title: Re: Orion.GetLastGump or GetGump() not suit for 1.26.4 client?
Post by: altiric on September 09, 2023, 07:33:32 PM
Instead of Wait('useitemdelay') try Orion.WaitForGump()
It's possible useitemdelay is too short to catch the gump poping up.
You'll also need to use Orion.Print(gump0.ID()) not (gump0.ID)