ScriptUO
Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: Cerveza on October 20, 2008, 06:46:50 AM
-
I've been wanting to do this for some time... Soliciting inputs and maybe I'll work on it.
A potion drinking SUB routine that will sense if a hand is free and react intelligently.
Determine how to free up a hand for drinking.
1 - two handed weapon in hands - fast weapon switch to see if one hander is alternate weapon, if NOT then switch back and return without drinking.
2 - two handed weapon in hands - fast weapon switch to see if one hander is alternate weapon, if SO then drink, switch and return.
3 - shield and weapon in hands - drop shield, drink, arm shield.
4 - shield and spell book - drop spell book, drink, arm spell book.
Determine what to drink.
1 - Greater Heal
2 - Greater Cure
3 - Total Refresh
4 - Greater Agility
5 - Greater Strength
Nightsight, etc... ?
Include eating stuff?
I want to make this a sub routine that would be easily integrated to anyones script. Include a simple call and timer when required. Something like:
gosub QUAFF g_cure
drink a greater cure
gosub QUAFF g_heal right
force a disarm right hand, then drink a greater heal, then rearm right hand - over rides the subs logic
I'm still in the pre-pre-pre-planning phase. If this is already available then disregard completely. If anyone has inputs, please post them here and I might start some preliminary data gathering.
Thanks.
-
Kool idea! Don't forget timers too. If you get one that works for two handed weps intelligently, that would be impressive.
-
I have some great uber-fast disarm/rearm subs somewhere I'd donate to the cause.
-
Great, I'll definitely be needing that. Quicker then the default "quick weapon switch"?
I'm not sure I want to go through a "what weapon do you want to disarm" setup. I'll make some basic rules and leave it up to the user to have a one hander as a secondary weapon. I don't want any config for this at all, just a plug-n-play sub.
Right now I'll just gather up the data required. Timers will be set in the sub itself...
What factors would be involved in determining what to do to free up a hand for drinking?
-
These are nice because you just give it the #FINDID, and it'll arm you. Disarm/rearm of the same weapon/shield then is handled with the standard event macros.
I guess you'll just need to be aware of what's being held in the off hand and not disarm that. It's been a while since I've done anything with that stuff however.
-
I'm thinking of making a listing of every two handed weapon. If it's found in right or left hand (some two handers are in the opposite hand, like some bows) then the sub knows to try the "equip last weapon" of event macro 37 0.
I don't think I'll need to put in every type of weapon in the game, just two handers, spell books, and shields. I mean if someone is running with a fishing pole and a lantern, they probably shouldn't be in a situation requiring potions.
Of course, that said, I'm sure I'll have users chiming in with "why won't this work with my Halloween 2001 trick or treat bag and my event item dragon scrotum shield equipped?"
-
you gota add eating apples in there some where with all the omen curse strangles going on in game plus the timer has been changed on them so they are worth carrying around now i think its like 10 sec. how about a trap box too keep the pesky para spamers off ya. you can make the ultimate life saver script all in one oh ya dont forget to add the band aid part in there too
-
Still on the list of "Things I wish I had time to get to, but won't for a while".
-
*necromances the thread*
I know it has been a while, but is there any progress? Such a sub sounds really useful! But you should definitely add also to disarm the weapon but shield, in situations when you are very low health it's better disarming the weapon and parry a blow than the other way round ;)
-
Nope, none at all :(
-
That's a pity... i'll wait for it and hope you will do something with it... i would try it for myself, but this task is too hard for me i think :D
-
I've been wanting to do this for some time... Soliciting inputs and maybe I'll work on it.
A potion drinking SUB routine that will sense if a hand is free and react intelligently.
Determine how to free up a hand for drinking.
1 - two handed weapon in hands - fast weapon switch to see if one hander is alternate weapon, if NOT then switch back and return without drinking.
2 - two handed weapon in hands - fast weapon switch to see if one hander is alternate weapon, if SO then drink, switch and return.
3 - shield and weapon in hands - drop shield, drink, arm shield.
4 - shield and spell book - drop spell book, drink, arm spell book.
Determine what to drink.
1 - Greater Heal
2 - Greater Cure
3 - Total Refresh
4 - Greater Agility
5 - Greater Strength
Nightsight, etc... ?
Include eating stuff?
I want to make this a sub routine that would be easily integrated to anyones script. Include a simple call and timer when required. Something like:
gosub QUAFF g_cure
drink a greater cure
gosub QUAFF g_heal right
force a disarm right hand, then drink a greater heal, then rearm right hand - over rides the subs logic
I'm still in the pre-pre-pre-planning phase. If this is already available then disregard completely. If anyone has inputs, please post them here and I might start some preliminary data gathering.
Thanks.
I've been thinking about doing this as well.. I'm glad someone else is going to do it LOL!! :) SO that said let me add a little fuel to the fire... different heal pots have different timers. I've been playing around with how I would approach this script for awhile (which is why I actually never got to the coding part).... but let me lay this on you...
Have you thought about doing something about measuring damage per second somehow and having the script adjust intelligently the style in which it utilizes different heal pots...
For example...
Chug a lesser a regular and then a larger one (since the timers are smaller on the other ones, you could actually heal more PER SECOND in some instances by combining the two or three)
Anyway just a thought to royally screw up your planning hehehe
-
so now that all the smart peeps at ea have jacked up chugging you think this is still gona work?. i dont see why they had to mess with the heal pots, im not sure if all pots are going to go through immunity thing all a see is heal but the one they realy needed to do was cure pots atleast just put a timer on it so peeps can insta cure every sec when deadly or leathal poised some time ea is so dam ignorant to the game its not even funny
-
Edited
-
Hey cool! Thanks for this MD.
-
No problemo, TM! Glad I can help! You have access to contributors, so you can pull my whole script (cuz I probably missed a variable or two that you need when I cut it out of the script to post here) and take a look to see exactly how I did it. I think it works quite nicely, although you do have to be careful about what personal macros you hit when you're in the middle of chugging. For example, I found that if I hit one of my Arm Weapon 1 (2, 3, or 4) or my Equip Last Weapon macro while the script is attempting to drag the shield or weapon it can often cause the client to crash. But if you're careful, it works flawlessly! I'm gonna try to post a bit more over here instead of WinUO, but we'll see how it goes!!
-
There's some safety's you can put in to ensure nothing is on cursor, or nothing will be dragged on screen while your drinking.
Here's a little example that you can use to see if you have a target cursor up, or something being lifted.
sub Check_Status
if #targCurs = 1 || #lLiftedKind = 1
return #TRUE
return #FALSE
Then you can use a switch like
if #result = #FALSE
to continue your potions.
-
"why won't this work with my Halloween 2001 trick or treat bag and my event item dragon scrotum shield equipped?"
lol, thats funny. dragon scrotum shield ftw!
-
I did do that Cerveza!
if #targcurs = 0
{
blah blah blah ;(I edited this out)
}
if #lliftedkind = 1
return
The issue is if it is in the process of executing the following code:
exevent drag %disarm
wait %delaybefore
set #lobjectid %pot
event macro 17
exevent dropc %dropobject
For example, if it's on the 3rd line, it already has something on the cursor, so if you hit your EquipLast Weapon macro while it's doing that, you crash. Unless you make all your macros in EUO, there's no way to avoid it!
-
LOL Cool, didn't look over the script first.
There's always going to be issues with drag/drop and crashes. We just do the best we can to avoid them.
Looks like you've done about all you can.
-
Yea, it just really sucks when you're in a big fight or things are getting hairy when you're fighting 1v4 at the gate and you hit a bad key and crash yourself =[
-
Thats why you put everything into one GI-NORMOUS script :)
Then you can control EVERYTHING and every keystroke ;)
-
I think my next script will be titled Maddog UO Player Script. Basically it plays the game for you. It logs you in as soon as you get home from class or work, then recalls to yew gate and does a run through, looking for how many noobs are on. It may possibly stop to call a couple of them "GATE TRASH!" or say something along the lines of "GO BACK TO TRAM YOU PIECE OF *bleep* TAMER!" After that, it will run through despise to see if a small group of blues are trying to get some powerscrolls. Then it runs through Fire and Deceit to see if any of the SNEAKY blues are trying to sneak a spawn off. It then recalls back to your house (since nothing is going on) and looks through your armor to see if you can improve your suit at all. After swapping out piece after piece, it looks at your suit and realizes that you're right back to the suit you started with! It then recalls BACK to the gate, owns a few noobs by spamming para on idiots with no resist and a trapped box script. The script then goes afk for 10 mins at the gate, comes back and spams LOL because you were just afk at the gate for 10 mins and no one killed you. It then recalls back to your house and starts training some stupid skill like Taste ID or Forensic Eval just because C2 wrote a cool script to train it and "Hell, why not? I have every other skill already on a soulstone!" The script then gets bored, turns on the TV and watches infomercials at 2am while training skills. Eventually the script just falls asleep.
Anyone wanna help me with debugging the script?
-
Thats too funny, thats about the exact same thing i did yesterday after i got up.
-
Hahahahahahaha, That Is A Funny Script! Figured i'd post something similar to your chugger that I use in a Pet player script scenario, also comes in handy when not using a pet player though. Havent added a disarm Function yet though. It just reacts to certain scenarios.
If your poisoned
Cure
If Your health is below a certain point
Heal
If Stamina is below A certain point
refresh
if Dex Timer is up
Agility
if Str timer is up
Strength
Sub Pots
Finditem %2Handed_Weapons C_ , #Charid
if #Findcnt > 0
return
finditem %Weapons C_ , #charid ; shields is included in weapons
if #findcnt > 1
Return
if #findtype in %Bow
{
event property #findid
if Balanced Notin #property
return
}
if %LLiftedid <> #lliftedid
{
set %Lobject_Timer #scnt2 + 10
set %Lliftedid #lliftedid
}
if %lobjectid <> #lobjectid
{
set %Lobject_Timer #scnt2 + 10
set %Lobjectid #lobjectid
}
if *Man_Whore_Army_Heal_Cure = -1
{
if C in #charstatus
{
Finditem %Cure_Pot C_ , #backpackid
if #findcnt > 0 && %Lobject_Timer < #Scnt2
{
set #Lobjectid #findid
event macro 17 0
set %Lobject_Timer #scnt2 + 10
set %Lobjectid #lobjectid
}
}
set %Lowest_Health #Maxhits / 2
if #hits < %Lowest_Health
{
finditem %Heal_Pot C_ , #Backpackid
if #findcnt > 0 && %Heal_Pot_Timer < #Scnt && %Lobject_Timer < #Scnt2
{
set #Lobjectid #findid
event macro 17 0
set %Lobject_Timer #Scnt2 + 10
set %Heal_Pot_Timer #Scnt + 12
set %Lobjectid #lobjectid
}
}
}
if *Man_Whore_Army_Dex_Str = -1
{
if %Str_Timer < #scnt
{
Finditem %Str_Pot C_ , #Backpackid
if #findcnt > 0 && %Lobject_Timer < #Scnt2
{
set #lobjectid #findid
event macro 17 0
set %Lobject_Timer #Scnt2 + 10
set %Str_Timer #Scnt + 115
set %Lobjectid #lobjectid
}
}
If %Dex_Timer < #Scnt
{
Finditem %Dex_Pot C_ , #Backpackid
if #findcnt > 0 && %Lobject_Timer < #Scnt2
{
set #Lobjectid #findid
event macro 17 0
set %Lobject_Timer #Scnt2 + 10
set %Dex_Timer #Scnt + 115
set %Lobjectid #lobjectid
}
}
}
If *Man_Whore_Army_Refresh = -1
{
Finditem %Refresh_Pot C_ , #Backpackid
if #findcnt > 0 && %Lobject_Timer < #scnt2
{
set #lobjectid #findid
event macro 17 0
set %Lobject_Timer #scnt2 + 10
set %Lobjectid #lobjectid
}
}
Return
-
Nice, thanks for the contribution.
-
Maddog that is private level disarm rearm stuff lol. i shared that idea in hopes it wasn't on public boards hehe.
-
Hmm.... Interesting. Definitely Liking this site!!! Lots of little Tricks.