1
Stealth Client / Re: NPC Shop problem
« on: January 23, 2016, 08:13:10 PM »
Thanks for your reply.
I just PM the information to you.
I just PM the information to you.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
using System;
using ScriptSDK.Items;
using ScriptSDK.API;
using ScriptSDK.Data;
using ScriptSDK.Engines;
using ScriptSDK.Gumps;
namespace ScriptSDK.Items
{
[QuerySearch(new ushort[] { 0x22C5 })]
public class RuneBook : Item
{
private ushort _point;
public RuneBook(Serial serial)
: base(serial)
{
this.UpdateLocalizedProperties();
this._point = 0;
}
public RuneBook(uint ObjectID) : base(ObjectID)
{
this.UpdateLocalizedProperties();
this._point = 0;
}
public string Name
{
get
{
var n = ClilocHelper.GetParams(this.Properties, 1070722);
if (n.Count > 0)
return n[0];
else
return "";
}
}
public bool Exceptional
{
get
{
if (ClilocHelper.GetIndex(this.Properties, 1060636) > -1)
return true;
else
return false;
}
}
public string CraftedBy
{
get
{
var n = ClilocHelper.GetParams(this.Properties, 1050043);
if (n.Count > 0) return n[0]; else return "";
}
}
public bool Open(double MaxDelay = 2000)
{
DateTime dateTime = DateTime.UtcNow.AddMilliseconds(MaxDelay);
this.DoubleClick();
Stealth.Client.Wait(1000);
do
{
for (ushort i = 0; i < GumpHelper.Count(); i++)
{
if (Stealth.Client.GetGumpSerial(i).Equals(this.Serial.Value))
{
return true;
}
}
} while (DateTime.UtcNow < dateTime);
return false;
}
public bool Next()
{
this._point = (ushort)(this._point + 1);
if (this._point > 16) { this._point = 1; }
Console.WriteLine("Go to Point " + this._point);
return this.Recall(this._point);
}
public bool Recall(ushort Point, double MaxDelay = 5000)
{
DateTime dateTime = DateTime.UtcNow.AddMilliseconds(MaxDelay);
int CurX = Stealth.Client.GetX(Stealth.Client.GetSelfID());
int CurY = Stealth.Client.GetY(Stealth.Client.GetSelfID());
if (this.Open() == false) { return false; }
GumpHelper.SendClick(this.Serial, 49 + Point); // Start From 50
do
{
Console.WriteLine("Going...");
Stealth.Client.Wait(500);
if (dateTime < DateTime.UtcNow) { return false; }
} while (Stealth.Client.GetX(Stealth.Client.GetSelfID()) == CurX &&
Stealth.Client.GetY(Stealth.Client.GetSelfID()) == CurY);
return true;
}
}
}
Mobile b = new Mobile(new Serial(0x00B14FC5));
ScriptSDK.Configuration.ContextOptions.Initialize();
Console.WriteLine(b.ContextMenu.Parse());
Console.WriteLine(b.ContextMenu.Entries.Count);
Console.WriteLine(b.ContextMenu.Click(3006123)); // True;
Console.WriteLine(a.ContextMenu.Click(3006123)); // False;
№: 13|ID:|$4074BD4D|type|$0DF0|Color|$0000|Name|black staff|Price|13|Cliloc||Quantity|19
....
№: 79|ID:|$408EBEA7|type|$0DF0|Color|$0000|Name|black staff|Price|13|Cliloc||Quantity|40 <-- this item's quantity should be 1 (that is I sell back to the vendor)
Console.WriteLine("Start");
Console.WriteLine("SDK Version : "+SDK.Revision);
ScriptSDK.SDK.Initialize();
Mobile a = new Mobile(new Serial(0x004230E2));
a.ContextMenu.Parse();
Console.WriteLine(a.ContextMenu.Entries.Count);
Mobile b = new Mobile(new Serial(0x00B14FC5));
b.AttachContextMenu();
Console.WriteLine(b.ContextMenu.Parse()); // Return False ?
Console.WriteLine(b.ContextMenu.Entries.Count);
a.ContextMenu.Click(3006123);
Console.WriteLine("End");
Console.ReadKey();
SDK Version : 0.9.0
4
False
0
namespace ScriptSDK.API
{
public class Buff_DebuffSystemEventArgs : ObjectEventArgs
{
public ushort AttributeId { get; private set; }
public bool IsEnabled { get; private set; }
public Buff_DebuffSystemEventArgs(uint objectId, ushort attributeId, bool isEnabled)
: base(objectId)
{
this.AttributeId = attributeId;
this.IsEnabled = this.IsEnabled;
// Is it the reason why the return value incorrect?
// this.IsEnabled = isEnabled?
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ScriptSDK.API;
namespace StealthUO
{
class Program
{
static void Main(string[] args)
{
Stealth.Client.Buff_DebuffSystem += _onBuff;
Stealth.Client.CastSpell("Lightning Strike"); // Toggle On
Stealth.Client.CastSpell("Lightning Strike"); // Toggle Off
Console.ReadKey();
}
public static void _onBuff(object sender, Buff_DebuffSystemEventArgs e)
{
Console.WriteLine(e.AttributeId);
Console.WriteLine(e.IsEnabled);
}
}
}
1096
True
1096
False
But the result is1096
False
1096
False
520|3006123|Open Paperdoll|0|0
918|1115022|Open Titles Menu|0|0
915|1049594|Loyalty Rating|0|0
302|3006145|Open Backpack|0|0
416|1114299|Open Item Insurance Menu|0|0
418|3006201|Toggle Item Insurance|0|0
801|3006169|Toggle Quest Item|0|0
1014|1154113|Refuse Trades|0|0