Skip to content

Comparison with Injection

Jakub Linhart edited this page Dec 2, 2017 · 2 revisions

Cheat sheet

Injection Infusion
Define variable var i = 0 var i = 0;
if if i == 0 then ... else ... endif if (i == 0) { ... } else { ... }
while while i < 10 ... wend while (i < 10) { ... }
repeat repeat ... until i < 10 do { } while (i < 10);
define function sub func1() ... end sub static void func1() { ... }
call function func1() func1();
return value from function return 1; return 1;
Terminate all functions UO.exec("terminate all") UO.CommandHadler.TerminateAll();
Terminate function func1 UO.Exec("terminate func1") UO.CommandHandler.Terminate(("func1");
wait wait(1000) UO.Wait(1000);
print UO.Print('text') UO.ClientPrint("text");
say text using keyboard UO.Say('text') no equivalent, see ServerPrint
send text directly to server UO.ServerPrint('text') UO.Say("text");
use skill UO.UseSkill("Meditation") UO.UseSkill(Skill.Meditation)
cast spell UO.Cast("Night Sight") UO.CastSpell(Spell.NightSight)
Use type (crook) UO.UseType("0x13F5") UO.Use(Specs.Crook);
get current player health UO.GetHP() UO.Me.CurrentHealth
get max player health UO.GetMaxHP() UO.Me.MaxHealth
get current player mana UO.Mana UO.Me.CurrentMana
get player's location UO.GetX(), UO.GetY(), UO.GetZ() UO.Me.Location
press key UO.Press(33) UO.ClientWindow.PressKey(KeyCode.PageUp);

Targeting specific object

Injection

UO.WaitTargetObject(tamingTarget)
uo.UseSkill("Animal Taming")

UO.WaitTargetObject("self")
UO.Cast("Night Sight");

Infusion

UO.UseSkill(Skill.AnimalTaming);
UO.WaitForTarget();
UO.Target(tamingTarget);

UO.CastSpell(Spell.NightSight);
UO.WaitForTarget();
UO.Target(UO.Me);

Waiting for something in journal

Injection

repeat
    wait(100)
until UO.injournal('first awaited text') or UO.injournal('second awaited text')

if UO.injournal('first awaited text')
    # do some action
end if

if UO.injournal('second awaited text')
    # do other action
end if

Infusion

UO.Journal
    .When("first awaited text", () => { /* do some action */ })
    .When("second awaited text", () => { /* do other action */ })
    .WaitAny();
Clone this wiki locally