Author Topic: Chivalry 0.1 for Public Testing  (Read 3660 times)

0 Members and 1 Guest are viewing this topic.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Chivalry 0.1 for Public Testing
« on: May 18, 2009, 08:00:29 AM »
0
Code: [Select]
;=================================================================
; Script Name: Chivalry
; Author: VicVega
; Version: 0.2
; Shard OSI / FS: UO Legends
; Revision Date: 20/5/2009
; Purpose: Trains Chivalry to GM
; Globals: None
;=================================================================
; Instructions: You need to setup your fcr in %userFcr variable
;               It's 0 by default
;
;************************ Setup **********************************
gosub setup
;*********************** Main Loop *******************************
repeat
  gosub checkskill
  gosub chooseChivSpell
  while #mana >= %minManaToCast
    gosub castChivalrySpell
  gosub meditate
  while #mana < #maxMana
    gosub checkMeditateStatus
until #charGhost = yes
return
;************************* Subs **********************************
sub setup
  set %userFcr 0
  chooseskill chiv real
  set %startingskill #skill
  str len %startingskill
  str ins %startingskill #dot #strRes
  set %startingskill #strres
  set %successMessageTrance you_enter_a_meditative
  set %successMessagePeace you_are_at_peace
  set %failFocus cannot_Focus
  set %failWait you_must_wait
return

sub checkskill
  if #skill = #skillcap
     halt
  set %currentskill #skill
  str len %currentskill
  str ins %currentskill #dot #strRes
  set %currentskill #strres
  setuotitle SS %startingskill | CS %currentskill
  set %currentskill #skill
return

sub castChivalrySpell
  event Macro 15 %spell
  target
  event Macro 23 0
  wait %fcrDelay
return

sub meditate
  wait 1s
  event macro 13 46
  gosub scan %failFocus %failWait %successMessageTrance %successMessagePeace
  set %scanResult #result
return

sub checkMeditateStatus
if %scanResult = %failWait
{
  wait 1s
  event macro 13 46
  gosub scan %failFocus %failWait %successMessageTrance %successMessagePeace
  set %scanResult #result
}
if %scanResult = %failFocus
{
  wait 10s
  event macro 13 46
  gosub scan %failFocus %failWait %successMessageTrance %successMessagePeace
  set %scanResult #result
}
return

sub scan
  set %maxTimeOutScan 15
  set %timeout #scnt + %maxTimeOutScan
  set %jrnl #jindex
  scanjournal %jrnl

  while #scnt < %timeout
  {
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }

    for %journalCounter 1 %0
    {
      if % . %journalCounter in #journal
        return % . %journalCounter
    }
 }
return

Sub chooseChivSpell
  chooseskill chiv
  set %skill #skill real
  set %minManaToCast 10
  if %skill < 1000 && %skill > 849
  {
    set %spell 208  ; Noble Sacrafice
    set %minManaToCast 20
  }

  if %skill < 850 && %skill > 749
    set %spell 207  ; Holy Light

  if %skill < 750 && %skill > 649
  {
    set %spell 206  ; Enemy of One
    set %minManaToCast 20
  }

  if %skill < 650 && %skill > 549
    set %spell 204  ; Dispel Evil

  if %skill < 550 && %skill > 449
  {
    set %spell 205  ; Divine Fury
    set %minManaToCast 15
  }

  if %skill < 450 && %skill > 349
    set %spell 203  ; Consecrate Weapon

  if %skill < 350
  {
    set %spell 209  ; Remove Curse
    set %minManaToCast 20
  }
return

sub setFcrDelay
  if %userFcr = 6
    set %fcrDelay 1
  if %userFcr = 5
    set %fcrDelay 2
  if %userFcr = 4
    set %fcrDelay 3
  if %userFcr = 3
    set %fcrDelay 5
  if %userFcr = 2
    set %fcrDelay 10
  if %userFcr = 1
    set %fcrDelay 15
  if %userFcr = 0
    set %fcrDelay 20
return
« Last Edit: May 20, 2009, 06:57:34 AM by VicVega »
To learn, read.
To know, write.
To master, teach.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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: Chivalry 0.1 for Public Testing
« Reply #1 on: May 19, 2009, 12:53:17 PM »
0
VicVega has been busy!  :)

TY!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • 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: Chivalry 0.1 for Public Testing
« Reply #2 on: May 20, 2009, 05:31:58 AM »
0
Good stuff, thanks!
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 VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Chivalry 0.1 for Public Testing
« Reply #3 on: May 20, 2009, 07:01:13 AM »
0
Added support for FCR delay and other minor changes, I'll left pass a few more days in case someone notice something wrong and then I will post it on the "Submit your script" section.
To learn, read.
To know, write.
To master, teach.

Offline DeadIssue2

  • Sr. Member
  • *
  • Posts: 287
  • Activity:
    0%
  • Reputation Power: 3
  • DeadIssue2 has no influence.
  • Gender: Male
  • Respect: +21
  • Referrals: 1
    • View Profile
Re: Chivalry 0.1 for Public Testing
« Reply #4 on: May 22, 2009, 07:22:10 AM »
0
Tell ya what I just played with this one a bit. Now my shard hits ROT at 70 but from 0 to 70 was really a nice ride. Well thought out and well written.

Offline Toptwo

  • SunTigress's Hero!
  • Global Moderator
  • *
  • *
  • Posts: 2087
  • Activity:
    0%
  • Reputation Power: 21
  • Toptwo might someday be someone...Toptwo might someday be someone...Toptwo might someday be someone...Toptwo might someday be someone...
  • Gender: Male
  • Respect: +131
  • Referrals: 1
    • View Profile
Re: Chivalry 0.1 for Public Testing
« Reply #5 on: May 22, 2009, 02:20:10 PM »
0
Another GREAT script. I actually d/l this one and started it first before I saw your Bushido script. Started with a skill of 50 and had it to 55 in less then 30 min (I could have been faster but what warrior has med??) Great scrip...I guess I will be busy the next couple days developing yet another whammy on one of my other accts!

Thanks!

Toptwo
The final weapon is the brain. All else is supplemental.....  If you find yourself in a fair fight, your tactics suck.

Tags: