Author Topic: Chiv healer in progress...  (Read 5263 times)

0 Members and 1 Guest are viewing this topic.

Offline CasanovaTopic starter

  • Jr. Member
  • **
  • Posts: 63
  • Activity:
    0%
  • Reputation Power: 2
  • Casanova has no influence.
  • Marine. MMA Champion. Nerd.
  • Respect: +7
  • Referrals: 0
    • View Profile
Chiv healer in progress...
« on: December 27, 2012, 09:08:53 PM »
0
Okay I was looking for something that would heal me using chivalry and maybe my searching prowess is as poor as my scripting prowess but allow me to take you through my last 3 or so hrs.

Search for self healer - nothing that was simple or as easy as that I could understand.
Started looking for something just plain and simple to understand - find Cervezas bushido/ai script that was based on mana...

Code: [Select]
gosub setpixel-LightningStrike
gosub setpixel-ArmorIgnore
display ok Ready to Begin

repeat
if #mana > 30
  gosub exec-ArmorIgnore
if #mana < 30
  gosub exec-LightningStrike
wait 1
until #false

sub exec-LightningStrike
wait 5
cmppix 1 t ; Lightning Strike
  return
event macro 15 149
wait 5
return

sub exec-ArmorIgnore
wait 5
cmppix 2 t ; Lightning Strike
  return
event macro 35 0
wait 5
return

sub setpixel-LightningStrike
event macro 15 149
display ok Move the mouse to your Lightning Strike Icon.$You have 2 seconds
wait 2s
savePix #CURSORX #CURSORY 1
wait 5
return

sub setpixel-ArmorIgnore
event macro 35 0
display ok Move the mouse to your Armor Ignore Icon.$You have 2 seconds
wait 2s
savePix #CURSORX #CURSORY 2
wait 5
return

Now I'm thinking well if this can check against mana to then do something maybe I can change it to check hp to cast close wounds...

As a total and complete newb programmer/scripter I didn't even know where to start, so I started searching for help guides, tutorials heck anything I could think of that might aid me in changing it to what I desired, and JUST when I was about to give up I stumbled across the Easyuo wiki in the tool section of script uo!!

Once I found out what event macros were I started making some changes, saving them and opening/running them in easyuo. Step by step and save by save I got to here and while likely the most ridiculous thing some of you have ever seen I'm excited by it! Haha simple right?

Code: [Select]
repeat
if #hits < 114
  gosub healme
until #false

sub healme
 event macro 15 202
 event macro 25 0
 event macro 23 0
return

Now obviously this is so crude... but it's my first time and although I'm falling asleep writing this I can't wait to get back at it tomorrow after work. I plan on adding a check for poison and a sub to cast cleanse by fire and maybe a couple other little fun things!!!

I'm hooked! I'm up for any constructive criticism or otherwise.

Casa


Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: Chiv healer in progress...
« Reply #1 on: December 27, 2012, 10:07:15 PM »
0
Suggestion for something I noticed...

You have the line:
Code: [Select]
if #hits < 114
Most likely this means that 114 is perhaps your maximum HP minus 20 (or something similar). Instead of putting in a hard-coded value (like 114), you may want it to work with different characters that have a different amount of HP. So I would recommend using:
Code: [Select]
if #hits < ( #maxhits - 20 )
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Chiv healer in progress...
« Reply #2 on: December 28, 2012, 02:11:53 AM »
0
When casting you want to be careful. You don't want to overcast spells and get caught in a fizzle loop. You also want to make sure to scan for fizzles.

Something like uh...

Code: [Select]
set %dmgBeforeHeal 25
set %spellTimer #scnt2


if #hits < (#maxhits - %dmgBeforeHeal) && ( %spellTimer < #scnt2 )
  gosub castHeal

sub castHeal
  event macro 15 202
  set %spelltimer #scnt2 + %safety
  gosub fizzleCheck
  if %fizzled = #true
    return
  else
    event macro 23 0
return

sub fizzleCheck
;insert some journal scanner here to check for fizzles.
return

Just something to get you started.



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline CasanovaTopic starter

  • Jr. Member
  • **
  • Posts: 63
  • Activity:
    0%
  • Reputation Power: 2
  • Casanova has no influence.
  • Marine. MMA Champion. Nerd.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: Chiv healer in progress...
« Reply #3 on: December 28, 2012, 05:07:44 AM »
0
Thank you Maddog and dxrom. I'll check both of these out and put up the results tonight.

Post Merge: December 28, 2012, 07:30:50 PM
Suggestion for something I noticed...

You have the line:
Code: [Select]
if #hits < 114
Most likely this means that 114 is perhaps your maximum HP minus 20 (or something similar). Instead of putting in a hard-coded value (like 114), you may want it to work with different characters that have a different amount of HP. So I would recommend using:
Code: [Select]
if #hits < ( #maxhits - 20 )


Ok Made this change. Went with ( #maxHit - 10 ) though. Thank you!

Casa

Post Merge: December 28, 2012, 05:34:41 PM
When casting you want to be careful. You don't want to overcast spells and get caught in a fizzle loop. You also want to make sure to scan for fizzles.

Something like uh...

Code: [Select]
set %dmgBeforeHeal 25
set %spellTimer #scnt2


if #hits < (#maxhits - %dmgBeforeHeal) && ( %spellTimer < #scnt2 )
  gosub castHeal

sub castHeal
  event macro 15 202
  set %spelltimer #scnt2 + %safety
  gosub fizzleCheck
  if %fizzled = #true
    return
  else
    event macro 23 0
return

sub fizzleCheck
;insert some journal scanner here to check for fizzles.
return

Just something to get you started.

Okay. I'm trying to look into the journal scanning stuff using the easyuo wiki... It's a bit beyond my newb level but I'm gonna take a swing at it.... Standby! Haha

Casa
« Last Edit: December 28, 2012, 05:34:42 PM by Casanova »

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Chiv healer in progress...
« Reply #4 on: December 31, 2012, 08:25:58 AM »
0
This is the Journal Scanning Sub I've been using for ages.  I think I borrowed it from somewhere but don't honestly recall..

Code: [Select]
START:

  Msg 1 One $
  set %Before_Action_jindex #jindex
  Msg 2 Two $
  set %sendThis #jindex - %Before_Action_jindex
  Gosub Checkjournal %sendThis 2_Two
  If #Result = #True
    Display ok You've Found the journal Entry you scanned for !
  Msg 3 Three $

Halt
;------------------------------------
Sub CheckJournal
;%2 = Message to scan for (including underscores)
;%1 = How far to scan up (optional - default = 1)
; #result = #true if the message IS found, #false if otherwise
nameSpace Push
nameSpace local J
if %0 = 0 || %0 = n/a
   set %1 1
for !_i 1 %1
{
   scanjournal !_i
   if %2 in #journal
   {
      nameSpace Clear
      nameSpace Pop
      set %Jindex_success #jindex
      Return #true
   }
}
nameSpace Clear
nameSpace Pop
Return #false

Hope this gives you a place to start .  I just insert this line

set %Before_Action_jindex #jindex

Right before I perform the action that generates the Message I want to scan for  and then insert this line...

set %sendThis #jindex - %Before_Action_jindex

AFTER the action that generates the message has been performed.  You can then use the Sub whenever you want to check #true / #false if the message was found.
« Last Edit: December 31, 2012, 08:33:39 AM by Alpha »

Offline CasanovaTopic starter

  • Jr. Member
  • **
  • Posts: 63
  • Activity:
    0%
  • Reputation Power: 2
  • Casanova has no influence.
  • Marine. MMA Champion. Nerd.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: Chiv healer in progress...
« Reply #5 on: December 31, 2012, 08:43:57 AM »
0
This is the Journal Scanning Sub I've been using for ages.  I think I borrowed it from somewhere but don't honestly recall..

Code: [Select]
START:

  Msg 1 One $
  set %Before_Action_jindex #jindex
  Msg 2 Two $
  set %sendThis #jindex - %Before_Action_jindex
  Gosub Checkjournal %sendThis 2_Two
  If #Result = #True
    Display ok You've Found the journal Entry you scanned for !
  Msg 3 Three $

Halt
;------------------------------------
Sub CheckJournal
;%2 = Message to scan for (including underscores)
;%1 = How far to scan up (optional - default = 1)
; #result = #true if the message IS found, #false if otherwise
nameSpace Push
nameSpace local J
if %0 = 0 || %0 = n/a
   set %1 1
for !_i 1 %1
{
   scanjournal !_i
   if %2 in #journal
   {
      nameSpace Clear
      nameSpace Pop
      set %Jindex_success #jindex
      Return #true
   }
}
nameSpace Clear
nameSpace Pop
Return #false

Hope this gives you a place to start .  I just insert this line

set %Before_Action_jindex #jindex

Right before I perform the action that generates the Message I want to scan for  and then insert this line...

set %sendThis #jindex - %Before_Action_jindex

AFTER the action that generates the message has been performed.  You can then use the Sub whenever you want to check #true / #false if the message was found.

Thanks Alpha! Been switching back and forth from my final research project on Renewable Technology and reading journal scanning tutorias and subs within scripts hahah not productive at all!

Thanks Again,
Casa

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Chiv healer in progress...
« Reply #6 on: December 31, 2012, 11:52:53 AM »
0
This is the Journal Scanning Sub I've been using for ages.  I think I borrowed it from somewhere but don't honestly recall..

Code: [Select]
START:

  Msg 1 One $
  set %Before_Action_jindex #jindex
  Msg 2 Two $
  set %sendThis #jindex - %Before_Action_jindex
  Gosub Checkjournal %sendThis 2_Two
  If #Result = #True
    Display ok You've Found the journal Entry you scanned for !
  Msg 3 Three $

Halt
;------------------------------------
Sub CheckJournal
;%2 = Message to scan for (including underscores)
;%1 = How far to scan up (optional - default = 1)
; #result = #true if the message IS found, #false if otherwise
nameSpace Push
nameSpace local J
if %0 = 0 || %0 = n/a
   set %1 1
for !_i 1 %1
{
   scanjournal !_i
   if %2 in #journal
   {
      nameSpace Clear
      nameSpace Pop
      set %Jindex_success #jindex
      Return #true
   }
}
nameSpace Clear
nameSpace Pop
Return #false

Hope this gives you a place to start .  I just insert this line

set %Before_Action_jindex #jindex

Right before I perform the action that generates the Message I want to scan for  and then insert this line...

set %sendThis #jindex - %Before_Action_jindex

AFTER the action that generates the message has been performed.  You can then use the Sub whenever you want to check #true / #false if the message was found.

Thanks Alpha! Been switching back and forth from my final research project on Renewable Technology and reading journal scanning tutorias and subs within scripts hahah not productive at all!

Thanks Again,
Casa

Magnetic manufacturing.

Create magnets to create motors to recharge and build magnets to build machines to use magnets to create energy to do with what you need. Turn that energy into more magnetic charging/building factories to produce more magnets and sustain more energy maybe?



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline CasanovaTopic starter

  • Jr. Member
  • **
  • Posts: 63
  • Activity:
    0%
  • Reputation Power: 2
  • Casanova has no influence.
  • Marine. MMA Champion. Nerd.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: Chiv healer in progress...
« Reply #7 on: December 31, 2012, 12:10:57 PM »
0

Magnetic manufacturing.

Create magnets to create motors to recharge and build magnets to build machines to use magnets to create energy to do with what you need. Turn that energy into more magnetic charging/building factories to produce more magnets and sustain more energy maybe?

Hrmmm I have permission to cite this? Haha. I think I'm going to stick with the basics though - Solar, Hydro, Wind...

Casa

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: Chiv healer in progress...
« Reply #8 on: December 31, 2012, 12:23:04 PM »
0

Magnetic manufacturing.

Create magnets to create motors to recharge and build magnets to build machines to use magnets to create energy to do with what you need. Turn that energy into more magnetic charging/building factories to produce more magnets and sustain more energy maybe?

Hrmmm I have permission to cite this? Haha. I think I'm going to stick with the basics though - Solar, Hydro, Wind...

Casa

Go for it.



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Tags: heal  chivalry