Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Injection Guide
#1

Here's my guide on how to use Injection. It includes the initial setup you have to do, some step by step explanations on how to make a few different types of macros and how to assign macros to hotkeys.

Install Steps:

1) Download Injection here and install it wherever you like.
2) Download the Injection clients here: here and extract them to your UO folder. When asked to overwrite any files say yes. IT IS VERY IMPORTANT TO OVERWRITE ANY FILES OR ELSE INJECTION MIGHT NOT LAUNCH
3) Double click ilaunch.exe to start injection.

Setup Steps:

4) Press change next to 'Client dir' and select your UO folder.
[Image: 10788616.png]

5) Press Edit List next to Server, select Xtreme Ultima Online, rename it to Imagine Nation Xtreme, change the Address to inx.xs4all.nl,2593 and leave Username and Password blank and press Save then OK.
[Image: 80892667.png]

6) Press Edit List next to Client and select the clients one at a time and press Delete. Now press the Choose button and select your desired client and enter a name and press Add. Repeat this for every client you want to add. I had to use the 4.0.5a m client. The others wouldn't load or would crash on me.
[Image: 65392581.png]

7) Press Change next to ignition.cfg and go to the folder where you installed Injection and select this file.

You're now ready to press Launch. If you don't get any errors you should see the UO window load and this window for Injection:

[Image: 91380355.png]

Take note of the two settings I circled in red.
-I unchecked Autostart because I kept getting a warning about this when starting UO.
-Check the box next to version and enter 4.0.1.



This version of Injection should come with some pre-made macros. To see these macros go to the Script tab and press the 'Edit current script' button.

[Image: 44302910.png]

As the comments at the top of this script say;

Quote:##To use these macros, just go to the hotkey tab and write: "exec Script_Name" without the "". Example: exec cast_GreaterHeal_self.
##When ever you see that an object is being used, you have to either replace that object by a number, or add the object name
##under the object tab. These are very simple macros, and therefor there will be no FAQ provided. Consult Yokos site for more infO:
##http://yoko.netroof.net/eng/injection.htm.

I started modifying these macros for myself and added them to my hotkeys. Here's how you do it. Go to the Hotkeys tab, in the field called Command enter exec and then the name of the sub you want to set a hotkey for and for the Hotkey field press whatever key you want to use then press the Add button and you should see it added to the list of hotkeys. In this screen shot I just added my resurrection macro as F1. Do this for all the macros you want to set a hotkey for.

If you make a macro to train a skill (like my anatomy macro below) you don't have to assign a hotkey, you can just go to the Scripts tab, next to the button Run function select the sub you want to run, then press the button. If you don't have a way to stop the sub select it from the list and press terminate.

[Image: 91712152.png]


That's all for how to setup Injection and where you have to go to make your own macros and assign them to hotkeys. I won't go into all the settings on the Main tab, you can play with these yourself.

Now it's up to you to make your own macros! Here are a few examples and explanations on how to make macros like these for yourself.

An example of a script you can make is to use a potion or some other item. If you know the code for the item you want to use you can make the script right away. If you don't know the code for the item you want to use, in UO write ,info and target the item. This will open a new window with a few different pieces of information. The important part is the Type. If you use ,info on a mana potion it will show the following;

Quote:ID=0x4006A408 Type=0x0F09 EKDQKMD Name=
Quantity: 19 Colour: 0x0388 Layer: 0 Has: 1
X=48 Y=62 Z=0 C=0x40196C00 F=0x00

Since I targetted a stack of mana potions my Quantity is 19 (will vary depending on how many are in the stack or if it's just 1), the color and type will change depending on what potion you select. XYZ is where the potion is in your pack, and C is the container it's in, this can be some helpful information if you want to make some more advanced scripts!

You can now go to your script in Injection and make a subroutine to use a mana potion. Mine looks like this:

PHP Code:
sub UseManaPotion()
    
uo.exec("usetype 0x0f09")
end sub 

It's the same thing for casting a spell using a scroll. Use ,info to get the Type of the scroll and make a macro just like the one above. Here's a macro to use a lightning scroll and target the last target:

PHP Code:
sub ScrollLightningLast()
    
uo.exec("waittargetlast")
    
uo.exec("usetype 0x1f4a")
end sub 

To cast a spell there's two options; cast the spell and you choose the target, or cast the spell and have Injection cast on your last target. Unlike casting with a scroll you don't need to get the Type, just write the spell name and if you want to cast it on yourself put self after the spell name, or if you want to cast it on your last target write last after the spell name. Pay careful attention to the syntax (where the ' ' and " " are).

PHP Code:
sub CastHeal()
    
uo.exec("cast 'Heal' self") ;cast heal on yourself
endsub

or

sub CastLightning()
    
uo.exec("cast 'Lightning'") ;cast lightning and wait for target
endsub

or

sub CastLightningLast()
    
uo.exec("cast 'Lightning' last") ;cast lightning on your last target
endsub 

Here's a macro to train anatomy for you and some explanations on what the different parts of the macro do.

PHP Code:
sub anatomy()

    
uo.print("Please choose a target to train anatomy on...")
    
uo.exec("useskill 'Anatomy'")
    
uo.exec('addobject target')
    while 
uo.targeting() ;wait until user selects a target
        wait
(10)
    
wend

    wait 
(1150) ;required delay to use the skill
    
    
while (1) ;infinite loop
        uo
.exec("useskill 'Anatomy'")
        
uo.exec("waittargetlast") ;repeatedly target the user selected target
    wait 
(1150) ;required delay to use the skill
    wend

end sub 

The lines sub anatomy() and end sub are header for what is called a subroutine. In programming you have a main portion of your program and that can call subroutines. The included macros in the version of Injection I linked to are all subroutines part of a main program. Every subroutine you make must have these two lines. If you forget the line end sub when you try to run that portion of the script it will keep going into the next subroutine until it reaches an end sub.

Whenever you make a loop in programming you need a starting point, an ending point, and in most cases an exit condition. The lines while 1 and wend are used to make an infinite loop without an 'exit condition'. In this case I said while 1 which means while true and since I didn't assign a variable to this exit condition that means it's always true and will never exit the loop.

When I was making this macro sometimes when I tried to run it I got an error message like "Line XX: Function not found - UO.EXE" this is because there's no command 'uo.exe' and the command I wanted to use was 'uo.exec'. Injection comes with quite a few error messages to guide you on where you made a mistake but they won't always be this helpful.

Remember to save the script before exiting Injection whenever you make any changes or you might lose them! You will also want to press the Save button on the Main tab to save all settings you use including hotkeys.

If you have any questions don't hesitate to ask. I'll do my best to help you and there are a lot of Injection users on INX who will also be willing to help you!
#2

lol nice, but i duno why you would post a guide if you yourself don't know how to use it :p you just asked me today and i fixed your anatomy macro but oh well ggz

btw your clients don't work because you didn't install it right lol
#3

smoke Wrote:lol nice, but i duno why you would post a guide if you yourself don't know how to use it :p you just asked me today and i fixed your anatomy macro but oh well ggz

btw your clients don't work because you didn't install it right lol


lol...

Bow Down To The ScareKing! jeje

[Image: scarecrowinxkd2.gif]
#4

Thanks for the help with that macro smoke Smile I was 1 line away from getting it to do what I wanted Big Grin
#5

We have some mistakes at our website injection that I'll change as soon as i arreve home Smile. I may add some more macros

Pum Pum Plaka Plaka

Don't you know I'm Loco?
#6

Here is some more information to help everyone make their own scripts on Injection. Some of this is taken from a few different guides I found when googling for information on Injection and some of it is based on my own trial and error while using Injection. Most of what I found was in Russian but I was able to recognize little bits of what I found since I've done some programming in the past. So to help everyone out I added my own explanations to try and explain what the different parts are. I hope this helps everyone out! Let me know if you have questions on any of this and I'll do my best to help you.

[SIZE="4"]Comments[/SIZE]

Throughout your scripts it's very helpful to leave yourself comments on why you're doing something since you might want to improve on a macro weeks after you first made it and you might not be able to figure out what you were doing. There are two symbols you can use when you want to make a comment. They are # and ;. Everything on the line after these symbols will be a comment and won't affect your script.


[SIZE="4"]Read-Only Properties:[/SIZE]

This is a list of your character's properties you can use in combination with other commands. I find these are most helpful when crafting. For example you would make a lightning scroll if your mana is above 50, say guards if your hits are less then 100, make a greater heal potion if you have more then 10 ginseng on you, etc.

[INDENT]UO.Life - Hit points
UO.Mana - Mana points
UO.Stamina - Stamina
UO.STR - Strength
UO.INT - Intelligence
UO.DEX - Dexterity
UO.Weight - Weight
UO.Armor - Armor
UO.Gold - Your total amount of money
UO.BM - Amount of Bloodmoss in your pack
UO.BP - Amount of Black Pearl in your pack
UO.GA - Amount of Garlic in your pack
UO.GS - Amount of Ginseng in your pack
UO.MR - Amount of Mandrake Root in your pack
UO.NS - Amount of Nightshade in your pack
UO.SA - Amount of Sulfurous Ash in your pack
UO.SS - Amount of Spider's Silk in your pack
UO.B - Amount of Bandaids in your pack
UO.AR - Amount of Arrows in your pack
UO.BT - Amount of bolts in your pack[/INDENT]


[SIZE="4"]Some Simple Commands:[/SIZE]

These are some very simple commands that I've used in the macro's I've made so far and that you can't do much without. I'll add more to this list as I get more comfortable using other commands.

[INDENT]wait (##) - this command will have your script wait ## milliseconds before continuing (1000 milliseconds is 1 second).

uo.print("text goes here") - this command will show a message in the bottom-left corner of the UO game window.

uo.say("text goes here") - this command will show a message above your character's head like when you write something and press enter ingame.

uo.cast('spell name here') - this command will give you a cursor and wait for you to select a target. When you select a target it will cast the spell you put between quotes. Make sure you write the spell exactly as is (including capital letters and spaces) or it won't work.

uo.exec("cast 'spell name here' self") - This will cast a spell on yourself instead of giving you a target and waiting for you to target yourself.

uo.exec("waittargetlast")
uo.exec("cast 'spell name here' last")
-When using these two commands together you will automatically cast a spell on your last target instead of giving you a target and waiting for you to target someone.

-uo.useskill('skill name here') - this will use whatever skill you put between quotes.Make sure you write the skill name exactly as is (including capital letters and spaces) or it won't work.[/INDENT]

Here is an example of something you can do with some of these commands. You can use either the uo.say command or the uo.print command for this. The only difference is where you will see the messages.

PHP Code:
sub Hello()
    
uo.say("Hello")
    
wait (1000)
    
uo.say("How are you?")
end sub 

If you want to make a script to say guards for you make sure to use uo.say and not uo.print or else you won't call them!!


[SIZE="4"]Comparison Operators:[/SIZE]

When writing your own scripts you will most likely run into different scenarios where you want to do something based on a condition. For example you want to stop crafting items when you reach a certain weight, or you want to check if you have enough resources before you make an item. There are 3 different parts you need when making a comparison. Here is the syntax you need to use when checking a condition:

property comparison value

Here's an example of how you use this:

uo.life < 50

Here is a list of all the different comparisons you can do (they can be used on much much more then just hits).

< - hits are less then 50
> - hits are greater then 50
<= - hits are less then or equal to 50
>= - hits are greater then or equal to 50
== - hits are equal to 50
<> - hits are not equal to 50


[SIZE="4"]Boolean Logic Operators:[/SIZE]

If you want to check for more then one condition before performing an action you can use any of the following:

&& - AND - both conditions must be true to perform an action
|| - OR - one of the conditions must be true to perform an action
NOT - the condition must be false to perform an action

Here is the syntax you need to use:

property1 condition1 value1 && property1 condition2 value2

Here's an example of how you use this:

uo.life > 1 && uo.life < 100


[SIZE="4"]Decisions and Loops:[/SIZE]

Here are some different commands you can use when scripting. Most of what you do will probably include one of these commands, or maybe even a combination of these commands.

If...Then...Endif

There are a lot of different ways you can use this statement. I'll explain the different ways you can use this statement one at a time and each example will get a little more complicated.

Part 1: The first way you can use this statement is to check for one condition, and if this condition is true your script will perform a specific set of actions it ordinarily won't do. If this condition is not true, your script will continue without performing these actions. Here is the syntax you need to use:

if property<value then
...
endif

Here is an example of how you use this:

PHP Code:
if uo.life<100 then
    uo
.say("Guards!")
endif 

This script will print a message in the bottom-left corner of the UO game window saying what's between the quotes if you have less then 100 life.


If you want to meet more then one condition before having your script perform a certain set of actions you can use the boolean expressions I mentioned above. Here is the syntax you need to use if this is the case:

if property>value1 && property<value2 then
...
endif

Here is an example of how you use this:

PHP Code:
if uo.life>&& uo.life<100 then
    uo
.say("You are injured and need to heal!")
endif 

This script will show a message in the bottom-left corner of the UO game window saying what's in the quotes only if the two conditions are true. If only one condition is true or neither condition is true it won't show anything.


Part 2: The next way you can use this statement will check for one condition and perform one set of actions if this condition is true and a different set of actions if this condition is not true before continuing with the rest of your script. Here is the syntax you need to use:

if property<value then
...
else
...
endif

Here is an example of how you use this:

PHP Code:
if uo.life<100 then
    uo
.say("You are wounded!")

else
    
uo.say("You are not wounded.")
endif 

This script will print a message in the bottom-left corner of the UO game window saying what's between the quotes depending how much life you have. As with Part 1, you can combine this with boolean expressions.


Part 3: The next way you can use this statement is to check for multiple specific conditions and perform a different set of instructions for each condition before continuing with the rest of your script. Here is the syntax you need to use:

if property<value1 then
...
endif
if property<value2 then
...
endif

Here is an example of how you use this:

PHP Code:
if uo.life<10 then
    uo
.say("You are severely wounded!")
endif

if 
uo.life<100 then
    uo
.say("You are wounded!")
endif 

This script will print a message in the bottom-left corner of the UO game window saying what's between the quotes depending how much life you have. You should notice we didn't assign a condition for when you have 100 life, so if you have 100 life nothing will be shown. Once again you can combine this with boolean expressions.


Part 4: The final way you can use this statement is to check for multiple specific conditions and perform a specific set of actions for each one, and perform another set of actions if none of these conditions are met. Here is the syntax you need to use:

if property<value1 then
...
end if
if property<value2 then
...
else
...
endif

Here is an example of how you use this:

PHP Code:
if uo.life<10 then
    uo
.say("You are severely wounded!")
endif

if 
uo.life>10 && uo.life<100 then
    uo
.say("You are wounded!")
endif

if 
uo.life==100 then
    uo
.say("You are not wounded")

else
    
uo.say("You're superhuman! You have more then 100 life!")
endif 

This is a very good technique for troubleshooting since you might encounter a condition you didn't expect the first time you wrote your script and now you can give yourself some kind of warning.
#7

For...Next Loop:

Here is the syntax of a for...next loop:

for var variable name condition start value to stop value
...
next

Here is an example of how you use this:

PHP Code:
for var counter 0 to 4
    uo
.say("hi!")
    
wait (1000)
next 

The first number of a for loop must always be 0. If you don't set it to 0 you will get a an error when running your script. The second number is how many times this loop will run. Remember, that since we have to start at 0 the above loop will say hi! 5 times and not 4 times (0,1,2,3,4 is 5 loops). The counter will automatically increase for you when your script reaches the next line.


While...Wend Loop:

Here is the syntax of a while...wend loop:

while variable condition stop value
...
wend

Here is an example of how you use this:

PHP Code:
var counter 1

while counter 5
    uo
.say("hi!")
    
wait(1000)
    
counter=counter+1
wend 

This loop will check how many times it ran when it gets to the first line. If the condition is not true it will exit. Since we set the counter to 1 instead of 0 before starting the loop and tell it to stop before it reaches 5, it will say hi! 4 times. Unlike with the for loop we have to increase the counter ourselves since there's no next line to do it for us.

If you want a loop to run for an unknown amount of loops, you can make an infite while loop by saying while 1 or while true instead of using a counter.


Repeat...Until Loop:

Here is the syntax of a repeat...until loop:

Repeat
...
until property condition stop value

Here is an example of how you use this:

PHP Code:
var counter=1

Repeat
    uo
.say("hi!")
    
wait(1000)
    
counter=counter+1
until counter
>

This loop will check how many times it ran at the end of the loop so it will always run at least 1 time. Like with the other loops, this loop will exit if the condition is not true when it's checked. Like with the while...wend loop we have to increase the counter ourselves since there's no next line to do it for us. You should also notice the exit condition here (counter > 5) is the opposite of the exit condition in the while loop (counter < 5).

Throughout all my loops you'll notice how parts of the text are indented. This is done to help you see where your loops begin and end. I highly recommend you do this when making your own!

More to come after I play with Injection some more and get some sleep!
#8

tbh everyone is making injection seem something more than it really is.

half the stuff u want to script is prolly better to make a macro in razor. a macro to craft items is 10x easier in razor. Also most of the stuff u posted is programming logic....like different loops/operators. This is why 90% of people SHOULD use razor ( a macro for craftable items are MUCH easier to make in razor)

also just because u use inject doesn't make you any better in pvp (in case some people thought that)
#9

you win the prize eighty no ones goign to right a 10k word essay to beat you lmfao, as far as i seen i've noticed many mistakes although im not going to read it all because it will take me 2 hours lmfao.. i also see your using programming logic which NOT always has to do with uo

oh well i tryed to explain it to you that you may be giving information that may not be correct

edit: this guide is basically explanning how to program not how to use injection lol
#10

I dont read the guides but, did someone told to save all your files after you done setting inject and macros to work.
Cause for some weird reason sometimes the macro files just stop working and you have to redo all.

Btw, have a way to transfer all your macros to someone so he dont need to setup any macro , just change the key if he want. Of course its good they learn how to setup a macro, but if they had all the pvp macros ready to use it gonna make it alot easy and more people wanting to use inject.
#11

Smoke if you really want to help new people you'd point out the errors in my guide to help them.

Yes, I am covering some parts about programming because that's what injection is, programming. Injection is not a translation program where you can write a sentence saying "If you have 100 mana make a lightning scroll and move it to this container" and it translates it into 'UO talk' for you.

Instead of just giving people a bunch of code that doesn't mean anything to them, I'm taking the time to explain the different parts and why they need to do things in a certain way so they can learn to make scripts on their own.


Now then, if you don't have questions about this guide or any suggestions for me on something else to cover or what some mistakes are, please stay out of this as you're just dirtying it up and people have to read through bickering and crap when they just want to read a guide.




Ryuuku make sure whenever you make changes in your script that you press the save button at the top of the edit window and save over your existing file (so it automatically loads the same one next time you start).

On the main tab you want to press the save button after doing any changes to the settings and adding hotkeys.

Something I noticed about the settings and hotkeys is if you enable certain settings for a character called BOB, press save on the man tab, then go on another character called JOHN those settings aren't the same and you will have to apply them all again (including your hotkeys) and press save. Now whenever you go back and forth between these characters their settings will be saved.

Finally, if you close Injection the next time you start it you might not see all your settings from last time. This is because Injection applies the settings based on what character you used (it makes a profile for each character). Once you log onto your character though then your settings should take effect.


To answer your other question, yes it is possible to send someone macros. If you downloaded the version of Injection I linked to on our main site, you should have a file called autoload.sc already with some macros in it. You can open this file in notepad to edit macros here, or if someone sends you a macro you can add it in. I suggest you don't open the file in notepad while you have injection open. It will be like you're editing the file twice at the same time and chances are whatever file you save last will take effect and any changes you made in the other open file will be lost!
#12

kk im done here you dont need a 100000 word essay to teach how to use injection nor script i learnt on my own and my 16 and started playing uo and using injection about 3 years ago

you don't even need to learn how to program for this because it's not that serious

and no i won't help you no more because whenever you ask me for something you just use it to benfit your self like i made your macro, you didn't even change the default macros which probably have wrong ids and types luda even saw you complain about how you said ohhh stupid injection doesn't work

not to mention the last time you asked me to make rune books for you also you gave me a small portion of gold to sell them for more each individual

stick to what you know, your not even using the recommended client


Forum Jump:


Users browsing this thread: 1 Guest(s)