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!


Messages In This Thread
Injection Guide - by Eighty Swords - 06-27-2009, 04:31 AM
Injection Guide - by smoke - 06-27-2009, 09:48 AM
Injection Guide - by imported_ScareCrow - 06-27-2009, 03:47 PM
Injection Guide - by Eighty Swords - 06-27-2009, 04:52 PM
Injection Guide - by imported_Muto - 06-27-2009, 05:10 PM
Injection Guide - by Eighty Swords - 06-28-2009, 07:41 AM
Injection Guide - by Eighty Swords - 06-28-2009, 07:42 AM
Injection Guide - by imported_LudaKrishna - 06-28-2009, 08:22 AM
Injection Guide - by smoke - 06-28-2009, 08:23 AM
Injection Guide - by imported_Ryuuku - 06-28-2009, 03:04 PM
Injection Guide - by Eighty Swords - 06-28-2009, 05:44 PM
Injection Guide - by smoke - 06-28-2009, 06:31 PM
Injection Guide - by imported_LudaKrishna - 06-28-2009, 06:49 PM
Injection Guide - by Eighty Swords - 06-28-2009, 07:36 PM
Injection Guide - by imported_Ryuuku - 06-28-2009, 07:40 PM
Injection Guide - by Eighty Swords - 06-28-2009, 08:13 PM
Injection Guide - by imported_AptaR - 06-28-2009, 09:16 PM
Injection Guide - by Eighty Swords - 06-29-2009, 02:06 PM
Injection Guide - by imported_AptaR - 06-30-2009, 12:15 AM
Injection Guide - by smoke - 06-30-2009, 12:15 AM
Injection Guide - by imported_LudaKrishna - 06-30-2009, 06:36 PM
Injection Guide - by smoke - 07-02-2009, 12:34 AM
Injection Guide - by Eighty Swords - 07-02-2009, 03:00 AM
Injection Guide - by smoke - 07-02-2009, 04:19 AM
Injection Guide - by imported_LudaKrishna - 07-02-2009, 06:18 AM
Injection Guide - by imported_Papa Smurf - 07-03-2009, 04:35 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)