Please, HELP! Trouble with Target macro...

Discussion in 'Razor: The Cutting Edge UO Assistant' started by MedievalName, Jan 6, 2018.

  1. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    I am trying to code an automated casino on a RunUO server (player run).
    I managed to make a working code using gold that goes as follow:
    Player drops 1k in a crate, dealer restocks continually from that crate until his gold count goes up and then process to drop the money in a secure container, roll dice and blah blah.

    Gold isn't convenient as it limits bets. So I tried to code macros that could ID checks.
    In theory, it was simple. Dealer takes check from crate, ID it and then proceeds accordingly.
    I was faced with a first problem; there doesn't seem to be a function in razor to target by type from a SPECIFIC container. My dealer would then ID the last check he IDd over and over again, meaning players could drop a deed of any type and they would still count as a 5k check.

    I then had the idea to have a second dealer standing next to the first one, whose job is only to ID checks from two other secured containers for organizing purposes. That way, I thought, Dealer one would take the check from the bet crate, drop it to secured container two. Dealer two would then take the check from that container and ID it. If it turned out to be an appropriate check, he would drop it to secured container three, where Dealer one would take it and transfer it to the main secured container and proceed with the game..

    The idea was to separate the character who IDd from the other containers in hope that he would, by default, ID what is in his backpack first (since the client never opened the other containers).

    // TL;DR //

    Even tho my Dealer isn't remotely linked to the container where the deed ends up, he will still proceed to ID it (even out of reach) instead of what is in his pack. This is very frustrating.. I even tried to make the dealer lock the chest and walk out of reach before processing what's in his pack but it will still state ''check 5000'', meaning the client knows it's somewhere near even if it's technically unreachable and use it as a target.

    My question is: Is there a way to force razor to forget about the last specific item used by the TargetByType action? Or a way to force it to target an item by type in a SPECIFIC container? My head hurts and I feel like I'm attempting the impossible and wasted several hours on this...


    I could post all the macros but I feel it is useless as the main problem rely on the toon who IDs the deeds.
     
    #1 MedievalName, Jan 6, 2018
    Last edited: Jan 6, 2018
  2. Enroq

    Enroq Sorceror

    Joined:
    Jan 28, 2011
    Messages:
    1,970
    Likes Received:
    245
    I believe, if I remember correctly, once you create your script and target the container you want, you can right click that line in the macro and convert to ID.
     
  3. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    Yes but every check has a different ID, even checks with the same amount..
    I tried to mess with the codelines (switching False to True, try to replace item specific ID to zero in the absolute target line, hoping it would just consider the container, etc) without success..

    The client knows where the item went and keeps it cached..
     
    #3 MedievalName, Jan 6, 2018
    Last edited: Jan 6, 2018
  4. Enroq

    Enroq Sorceror

    Joined:
    Jan 28, 2011
    Messages:
    1,970
    Likes Received:
    245
    Hmm. I'm a little confused.

    Why not just code your dealers to do what you want instead of trying to do it with a razor macro?

    You're quite limited in what you can do unless you want to modify razor's code, in which case.. it still seems kind of strange to modify razor and/or make a razor macro to implement a server feature.

    Maybe I'm missing something here but.. you should be able to easily accept both gold and checks? I know I've seen casino scripts before.
     
  5. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    It’s a player run casino. I came here out of despair opening someone with core knowledge could tell me if there is ANY way to make razor and/or the client to forget about the unreachable deed, or force it to ID from a specific container.

    Looking for fresh ideas as I feel like I’ve tried it all.
    Maybe a way to tweak the macro lines or the code to do so, or simply a feature that I missed..
     
    #5 MedievalName, Jan 7, 2018
    Last edited: Jan 7, 2018
  6. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    I realized that the lifing by type never fails to lift the good deed. If I get my macro to place it in the top of a container, is there code to target item by onscreen location? Can’t seem to find that either.. only relative location..
     
  7. Enroq

    Enroq Sorceror

    Joined:
    Jan 28, 2011
    Messages:
    1,970
    Likes Received:
    245
    Honestly I'm not sure, I'm installing UO now so I can open razor. I honestly don't think razor offers the type of functionality you want but I'll look through it.
     
  8. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    I have read that there is a « max update range » line coded on the client.. not sure how to locate it nor edit it, tho. If I could change it to one tile, it would probably make it work
     
  9. Enroq

    Enroq Sorceror

    Joined:
    Jan 28, 2011
    Messages:
    1,970
    Likes Received:
    245
    Do you know how to use the if/else statements?
     
  10. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    Yes. Here are my scripts:

    Dealer 1:

    Code:
    !Loop
    // Restocks deed from crate on the counter //
    Assistant.Macros.HotKeyAction|0|Restock Agent-5
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.AbsoluteTargetAction|0|0|1141223675|697|716|14|3709
    Assistant.Macros.PauseAction|00:00:00.5000000
    
    // If weight increases, take the deed and drop it to secured container number 2 //
    Assistant.Macros.IfAction|5|1|24
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.LiftTypeAction|5360|1
    Assistant.Macros.DropAction|0x46277E3F|(-1, -1, 0)|0
    
    // Wait until Dealer 2 processes the check, then restock from container 3 //
    Assistant.Macros.PauseAction|00:00:06
    Assistant.Macros.HotKeyAction|0|Restock Agent-5
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.AbsoluteTargetAction|0|0|1176993093|696|715|11|3650
    Assistant.Macros.PauseAction|00:00:01
    
    // If weight goes up (check cleared), drag the check to secured container 1 and proceed with the game //
    Assistant.Macros.IfAction|5|1|24
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.LiftTypeAction|5360|1
    Assistant.Macros.DropAction|0x46277C67|(-1, -1, 0)|0
    Assistant.Macros.HotKeyAction|0|Play: Dealer rolls 5k
    Assistant.Macros.ElseAction
    Dealer 2:

    Code:
    !Loop
    // Continually restock from secured container 2 //
    Assistant.Macros.HotKeyAction|0|Restock Agent-5
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.AbsoluteTargetAction|0|0|1176993343|696|715|7|3650
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.HotKeyAction|1368|
    
    // If weight goes up, proceed and use ID ITEM skill on deed (by type target is the problem here) //
    Assistant.Macros.IfAction|5|1|23
    Assistant.Macros.SpeechAction|0|52|3|FRC|2|16|3|Let me certify this check for you, Jack.
    
    // Tried lifting it and droping it to a specific location hoping it would target it or I could find a way to target this specific location in the pack... without success //
    Assistant.Macros.LiftTypeAction|5360|1
    Assistant.Macros.DropAction|0x41D87956|(44, 65, 0)|0
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.UseSkillAction|3
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.TargetTypeAction|False|5360
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.IfAction|4|0|bank check 5000
    Assistant.Macros.SpeechAction|0|52|3|FRC|2|16|3|Checks out. You may proceed.
    
    // If system state CHECK 5000, drop it to container 3 from where dealer 1 will take it and proceed with the game //
    Assistant.Macros.LiftTypeAction|5360|1
    Assistant.Macros.DropAction|0x46277D45|(-1, -1, 0)|0
    Assistant.Macros.PauseAction|00:00:00.5000000
    Assistant.Macros.AbsoluteTargetAction|0|0|1104705882|65535|65535|0|5399
    Assistant.Macros.ElseAction
    Assistant.Macros.SpeechAction|0|52|3|FRC|2|16|3|Doesn't seem like a 5k check... please take it back.
    Assistant.Macros.LiftTypeAction|5360|1
    Assistant.Macros.DropAction|0xFFFFFFFF|(697, 717, 13)|0
    
    See.. what I don't understand is that the LIFT BY TYPE gets it. It never fails to grab the last deed moved.
    But while using TARGET BY TYPE, it keeps the last IDd deed in cache for some reason... Let's say I drop a house deed in the crate, it'll drop it on the table after noticing it isn't a bank check.. that works but the next run will assume I want that house deed IDd again, even if it's out of reach..

    If you're wondering why this is so complicated and using 3 containers... it was an attempt at secluding the other deeds from the IDer. Dealer 2 never sees the content of the main secure container but.. the client still caches the information that the deed exists.. I'm leaving it as two dealers for now to keep chances on my side.. but I’m stuck..
     
    #10 MedievalName, Jan 7, 2018
    Last edited: Jan 7, 2018
  11. MedievalName

    MedievalName Wanderer

    Joined:
    Jan 6, 2018
    Messages:
    11
    Likes Received:
    0
    Found a way! By setting razor's Range Check Last Target to 0 and having it set last target by type and then using a dagger on said target, I managed to loop it until the client shows sysmessage ''Can't use bladed item on that'' and then proceed to the next step. The more items the client come across, the longer it takes to find it, tho... Wich brings another problem, if I want it to run 24/7, I have to reset the client manually every now and then as this process ends up taking a long time after a few runs.

     

Share This Page