C#:
using System;
using System.Linq;
using System.Collections.Generic;
using NewWidget.Core;
using NewWidget.Core.Native;
using NewWidget.Core.Scripting;
public class Script : ScriptBase {
public override void OnStart() {
base.OnStart();
CreateTimer(
1000,
() => Client.Zone == Zones.Siedge && Me.BuffEndtime(2398) == 0 && (Me.StateFlags & 0x40000) != 0x40000 && Client.IsForeground,
() => { Client.UseItem(10157); Wait(2000); }
);
}
}