Setting Simple Macro's etc.

Ask for help

Moderators: Murderator+, Murderator

Post Reply
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Setting Simple Macro's etc.

Post by fourtytwo »

Hey guys! I am new to injection because I just started playing free shards from OSI. I am used to UOA so I know how to set easy macros in UOA, but now when I try to use that logic in injection it does not work.

For example I'm wanting to be able to setup a macro to cast recall, and click the rune in my backpack that I choose automatically with the hit of a key.

In UOA it looks like:
use skill/cast spell
target

How would I set this up? Is there a better document about setting these types of macros and an extensive command list other than the one on the origional site meaning this one: http://yoko.netroof.net/eng/old_injecti ... ml#command

I see yoko's but i can't read the descriptions only the command. I'll keep messing with it and if I figure out a lot before someone responds I'll delete this topic.

If it is better that I just ask questions here then I will do so but I'm sure someone has a document out there, or if someone is just feeling in a helpful mood my AIM: jason1nk and MSN: vumpler@gmail.com

thanks guys!
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

For recall by rune you need set target trap and only after cast the spell.

Script for example:

Code: Select all

sub RuneRecall()
uo.waittargetobject("Rune ID")
uo.cast("Recall")
endsub


If you carefully read help about cast command, then you understand, that you can use:

Code: Select all

,cast 'Recall' 'Rune ID'


I correctly understand you problem?

Sorry for my clumsy English.
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

No you did excellent! Thanks a ton. I also read and found out how to set it to a key as well.

Another question is with looting bags and cutting corpses for hides with the click of a button.

I am trying to GM alchemy and on the shard I am playing to make a keg you have to drag the individual potions onto the keg to fill it. How do I write a script to drag greater heal potions onto a keg?

Also how do I have it to where when I hit a button it takes all items from one bag or corpse? and also cutting the nearest body/corpse for hides?

I tried this script and it doesn't work

Code: Select all

sub cut()
if uo.InJournal('Body') then
    wait(waiting)
    UO.waittargetobject('lastcorpse')
    UO.usetype('cleaver')                    ;Type - cleaver
    wait(500)
end if
end sub


and this one:

Code: Select all

sub cut()

    UO.waittargetobject('lastcorpse')
    UO.usetype('cleaver')                    ;Type - cleaver
    wait(500)

end sub


I get several errors.

Thanks for all of your help!
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

When I try to attempt cut it says "function not found - UO.INJOURNAL" and with the loot i get "Function not found - UO.GETDISTANCE" even though I am standing right next to the body
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

fourtytwo wrote:When I try to attempt cut it says "function not found - UO.INJOURNAL" and with the loot i get "Function not found - UO.GETDISTANCE" even though I am standing right next to the body

Update injection.dll to latest version.
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

ok that was definitely part of the problem. Now the loot script will sort of work. It took the gold from one of the creatures but nothing else... And then it just said it could find zero items.. And with the cut script it says "auto target canceled no item found"

The current script is:

Code: Select all

sub cut()

    UO.waittargetobject('lastcorpse')
    UO.usetype('cleaver')                    ;Type - cleaver
    wait(500)


And I am wanting to use my newbied dagger as what cuts the corpse.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

try it:

Code: Select all

sub cut() 
    uo.textprint(uo.getserial("lastcorpse"))
    UO.waittargetobject('lastcorpse')
    UO.usetype('cleaver')                    ;Type - cleaver
    wait(500)


And see, that script 'll write to text window.
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

"Auto targeting canceled
no item found"

is there anything I need to do before this will work? like target the dagger and name it a cleaver under objects?
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

Ok I fixed it. This is what I changed it to:

Code: Select all

sub cut()
    uo.textprint(uo.getserial("lastcorpse"))
    UO.waittargetobject('lastcorpse')
    UO.useobject('dagger')                    ;Type - dagger
    wait(500)
end sub
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

The only questions I have left is how would I set it to take every item out of a corpse and how do i set a macro to take greater heal potions from my backpack and place them in another bag.
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

If i correctly understand you problems, you need two scripts:
1. Script for loot all items from corpse.
2. Script for move GreaterHeal from backpack to any bag.

1.

Code: Select all

sub AutoLoot()
var corpse = uo.getSerial('lastcorpse') ; corpse for looting
uo.useobject(corpse) ; open corpse
checklag() ; wait while corpse opening
uo.findtype("-1","-1",corpse) ; find all items in corpse
; cicle - while having items in corpse
while uo.findcount()
uo.moveitem("finditem","0","backpack") ; move find item to backpack
wait(300) ; fastloot pause
uo.findtype("-1","-1",corpse) ; find all items in corpse
wend
endsub


2.

Code: Select all

sub MoveGH()
var gh = "0x0000000" ; gh for moving
var bag = "0x0000000" ; new gh container
uo.moveitem(gh,"1",bag)
endsub
flake
Expert!
Posts: 746
Joined: 2004-08-11 23:56:17
Location: The Citadel
Contact:

Post by flake »

I guess that he has many unstacking potions that he needs to move to the keg, so I advise this:

Code: Select all

sub MoveGH() 
var gh = "0x0000; Write GH bottle type here
var bag = "0x0000000" ; Keg ID here
    uo.findtype( gh, '-1', 'my' )
      while uo.findcount()
        uo.moveitem( 'finditem', 'all', bag )
        wait(600)
        uo.findtype( gh, '-1', 'my' )
     wend   
endsub
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

You guys are awesome... They actually changed the way we do kegs now though and it consists of double clicking the keg then click on the potion.

So the code would look something like:

double click keg
click potion type.

So what I need to do is use the command ,addtype gh then click on the potion.

that's a very simple script I'm sure.[/code]
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

Code: Select all

sub MoveGH()
uo.print("Select keg") ; print message
uo.addObject("keg") ; add object from target
while uo.targeting() ; while cursor is targeting
wait(100) ; delay
wend ; end while
uo.print("Select GH") ; print message
uo.addObject("GH") ; add object from target
while uo.targeting() ; while cursor is targeting
wait(100) ; delay
wend ; end while
var GH = uo.getGraphic("GH") ; add variable GH, from graphic type of GH object.
var keg = uo.getSerial("keg") ; add variable keg, from ID of keg object.
var cnt = uo.containerOf("GH") ; add variable cnt, from containter which contains GH object
uo.findtype(GH,-1,cnt) ; find `GH` in `cnt`
while uo.findcount() ; cicle - while found more zero item
uo.waittargetobject("finditem") ; set target trap to find item
uo.useobject(keg) ; use object - keg
checklag() ; checklag - run internal function. You can find her on this forum.
uo.findtype(GH,-1,cnt) ; find `GH` in `cnt`
wend ; end while
endsub
fourtytwo
Posts: 19
Joined: 2006-04-16 07:26:09

Post by fourtytwo »

You guys are awesome they work great! And if you ever need any health advice just ask I'm a doctor :D
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

fourtytwo wrote:You guys are awesome they work great! And if you ever need any health advice just ask I'm a doctor :D

Okay. I remember it.
Post Reply