Author Topic: ScriptUO Combat Companion  (Read 23724 times)

0 Members and 1 Guest are viewing this topic.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
ScriptUO Combat Companion
« on: December 23, 2008, 10:18:22 AM »
0
Code: [Select]
;============================================================
; Script Name: SUO Combat Companion   
; Author: Cerveza                     
; Version: B2.0                       
; Shard OSI/FS: OSI/FS                 
; Revision Date: 03/27/2009 
; Purpose: Control Repetative Combat Actions
;============================================================
;    ____         _      _  __   _ ___   
;   / __/ ___ _ _(_)_ _ | |_\ \ / / _ \ 
;   \__ \/  _| `_| | ` \|  _/ / \ \/ \ \
;   __/  \ (_| | | | |) | | \ \_/ /\_/ /
;   \____/\__|_| |_|  _/\__| \___/\___/ 
;                  |_|                   
;    |C|o|m|b|a|t| |C|o|m|p|a|n|i|o|n|   
;============================================================
; Revision History:
; v1.0b - First Beta Release
; v2.0b - Reorganized loop to remove evil goto's
;       - Added auto honor and attack
set %version 2.0b
;============================================================
; THIS IS A BETA COPY, NOT A RELEASE   
;                                     
; If you want to give this a try, make
; sure to post your results, both good
; and bad. If you want to help with   
; this project, please PM me on SUO.   
;                                     
;============================================================

Remember, this is a BETA! I haven't fully tested this at all.

History: Once there was an auto honor script, and a lightning strike script, and a curse weapon script, and a... well you get the idea. I was running several scripts at the same time to accomplish basic Sampire functions. This is a compilation of those scripts in one.

SUOCC is TM's Healing Commander and TM's CLaW Looter aware. That means this script will wait if either of those scripts are active. This script is also "enemy aware". It shouldn't just keep casting these combat spells if there's nothing around.

The setup sucks, yes. But it's necessary for later when a menu gets added. Speaking of which, someone could step up and volunteer to make a menu for this. I'm not sure I'll ever have the time.

In a nutshell.... SUOCC has:

Curse Weapon - duration based on Spirit Speak skill
Enemy of One - duration based on user setting
Evasion - timer set for OSI shards
Divine Fury - user setting for when to cast
Lightning Strike - auto
Trapped Crate - for breaking paralysis
Honor single target - user sets hotkey*
Cure/Heal/Refresh pots - timer for heals, note during setup ONE HANDED WEAPONS ONLY!

*Automatic Honor and Attack isn't implemented in this version. I will include it when I have a chance to test it further.

User settings found in the script:

Code: [Select]
; --==:: Setup ::==--

sub setup

  set %delay_eoo 120        ; time in seconds for Enemy of One
  set %delay_evasion 20     ; time in seconds for Evasion
  set %delay_heal_pot 10    : time in seconds for heal potions
 
  set %mana_eoo 20          ; mana level to use Enemy of One
  set %mana_ls 20           ; mana level to use Lightning Strike
  set %mana_curse 7         ; mana level to use Curse Weapon
  set %mana_evasion 10      ; mana level to use Evasion
  set %mana_divine 15       ; mana level to use Divine Fury
 
  set %hp_pot_heal 40       ; hit point level to drink Heal
  set %st_pot_stamina 60    ; stamina level to drink refresh
  set %key_hotkey_honor F10 ; hotkey for Honor
  set %st_df_stamina 100    ; stamina level to cast Divine Fury
 
  set %monster_auto_honor TC_UE_PI_FD_ ; swoop, miasma, sebrix/lissith

Future: I need to add in the auto honor, some more pixel things like momentum, counter attack, etc., and of course a menu with savable settings. Some checks later on to ensure certain actions were performed would be pretty nice as well. And, whatever you guys want added to it.

Remember feedback is critical and this is a SUO script. Meaning I don't care what you do to it for improvements as long as you post your work here to share with others.

UPDATE: 03/27/2009
v2.0b - Reorganized loop to remove evil goto's
- Added auto honor and attack

There are 2 attachment(s) in this post. You must register and post an acceptable introduction to download
SUOCC.txt
SUOCC20b.txt
« Last Edit: March 27, 2009, 06:03:13 AM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: ScriptUO Combat Companion
« Reply #1 on: December 23, 2008, 12:04:25 PM »
0
Can't wait to test this out on my wammy, whats left of him.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Combat Companion
« Reply #2 on: December 24, 2008, 08:16:35 AM »
0
Quote from: TrailMyx date=1230138130
Back to the topic....

You might look at marrying the icon setup from your code with what I did in my Bushido script.  It remembers your locations, and tests the icon validity. 

I'll check it and include.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline tandj99

  • Elite
  • *
  • *
  • Posts: 261
  • Activity:
    0%
  • Reputation Power: 1
  • tandj99 has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: ScriptUO Combat Companion
« Reply #3 on: December 26, 2008, 04:05:31 PM »
0
ok tried to play with this tonight and it seems to be in a constant loop of pause once you go through the setup of what you want the script to do. not sure if this is intended or not at this point.

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Combat Companion
« Reply #4 on: December 27, 2008, 10:33:00 AM »
0
Did you have something targetted? Something attacking you?

What was it looping? Just paused or waiting for an #enemyID?

It's supposed to do nothing until something is targetted or targeting you.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: ScriptUO Combat Companion
« Reply #5 on: December 27, 2008, 10:37:03 AM »
0
Could there be that annoying time where some ID gets stuck in the #ENEMYID?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline tandj99

  • Elite
  • *
  • *
  • Posts: 261
  • Activity:
    0%
  • Reputation Power: 1
  • tandj99 has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 1
    • View Profile
Re: ScriptUO Combat Companion
« Reply #6 on: December 27, 2008, 11:32:06 AM »
0
i was killing deamons in ish. i tried it again and still nothing after the setup when i step through it with f8 it gets stuck here:

     TM:
repeat
  ;event sysmessage #sCnt2 ; timer for testing purposes
  if #MENUBUTTON = pause
    gosub pause_script
 
  gosub Check_Status
  if #RESULT = #TRUE
    goto TM

which is line 36

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Combat Companion
« Reply #7 on: December 27, 2008, 04:11:20 PM »
0
Well, here's the sub routine and the setup for it...

Code: [Select]
sub Check_Status
  namespace copy TM_HEAL from global TM_healer
  namespace copy TM_loot_in_progress from global TM_loot
  wait 5
  if #targCurs = 1 || #lLiftedKind = 1 || !TM_HEAL = #TRUE || !TM_loot_in_progress = #TRUE
    return #TRUE
return

  set !TM_HEAL = #FALSE
  set !TM_loot_in_progress = #FALSE

If your not using TM's Healer or Looter then the variables should remain #FALSE and the script should continue. The sub also checks for the target cursor and any items being dragged on screen.

Just rem out the gosub check section and see what happens.....

Code: [Select]
;  gosub Check_Status
;  if #RESULT = #TRUE
;    goto TM
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: ScriptUO Combat Companion
« Reply #8 on: December 28, 2008, 03:42:40 AM »
0
Anyone get behind a menu on this one yet? I'm still toying although feeling like this needs to be the last "lip service" I give it before actually doing.

X
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: ScriptUO Combat Companion
« Reply #9 on: December 28, 2008, 08:21:57 AM »
0
Iwould build a menu for it but I have no freaking idea how to build them.....I need to get around to teaching myself.

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: ScriptUO Combat Companion
« Reply #10 on: January 06, 2009, 06:32:50 PM »
0
Okay I have been trying to mess with this all day but I keep just gettin gmyself killed as the script doesn't appear to be doing anything for some reason.  I have tried messing with the #enemyid and the FindCnt for it as well but no luck.  I just can't figure out why it doesn't want to play well with me :(

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Combat Companion
« Reply #11 on: January 06, 2009, 07:42:09 PM »
0
I spent less then 1 minute in game and got it working. If your dying using this, perhaps you shouldn't be fighting whatever you are while testing.

I changed this:
Code: [Select]
sub Check_Status
  namespace copy TM_HEAL from global TM_healer
  namespace copy TM_loot_in_progress from global TM_loot
  wait 5
  if #targCurs = 1 || #lLiftedKind = 1 || !TM_HEAL = #TRUE || !TM_loot_in_progress = #TRUE
    return #TRUE
return

to this:
Code: [Select]
sub Check_Status
  namespace copy TM_HEAL from global TM_healer
  namespace copy TM_loot_in_progress from global TM_loot
  wait 5
  if #targCurs = 1 || #lLiftedKind = 1
    return #TRUE
return

For some reason the TM globals are returning TRUE even when their respective scripts aren't running.

I'll see if I have some time to play with this in the next week or so. Edit that sub and try it again.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: ScriptUO Combat Companion
« Reply #12 on: January 06, 2009, 08:16:48 PM »
0
Actually there's a bit of a bug in that routine.  There's a return value for the positive instance, but no return value for the failure.  So really for the sub to be correct, you need to do this:

Code: [Select]
sub Check_Status
  namespace copy TM_HEAL from global TM_healer
  namespace copy TM_loot_in_progress from global TM_loot
  wait 5
  if #targCurs = 1 || #lLiftedKind = 1 || !TM_HEAL = #TRUE || !TM_loot_in_progress = #TRUE
    return #TRUE
return #FALSE

otherwise, you're not really sure what was in the value of #RESULT.

you can simplify that by

Code: [Select]
sub Check_Status
  namespace copy TM_HEAL from global TM_healer
  namespace copy TM_loot_in_progress from global TM_loot
  wait 5
return #targCurs = 1 || #lLiftedKind = 1 || !TM_HEAL = #TRUE || !TM_loot_in_progress = #TRUE

« Last Edit: January 06, 2009, 08:27:14 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline CervezaTopic starter

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Combat Companion
« Reply #13 on: January 07, 2009, 06:26:18 AM »
0
Cool, I was thinking that it defaulted to a #FALSE unless it was #TRUE in the sub.

I'll update it when then forums stabilize.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Xclio

  • Officially "The MAN"
  • Elite
  • *
  • *
  • Posts: 981
  • Activity:
    0%
  • Reputation Power: 9
  • Xclio has no influence.
  • Gender: Male
  • Respect: +56
  • Referrals: 1
    • View Profile
Re: ScriptUO Combat Companion
« Reply #14 on: January 07, 2009, 08:34:19 AM »
0
That very well coudl have been my problem, I was in a pretty crappy mood trying to test it and when I got killed the second time by a wyvrn because I didn't start my healing script I just got pissed off lol so relaly my testing was pretty limited but it does seem that if there was a stuck true statement in there that would have caused my problem.

Tags: