Author Topic: Resisting Spells 0.1 for Public Testing  (Read 2442 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
Resisting Spells 0.1 for Public Testing
« on: May 20, 2009, 10:46:08 AM »
0
Code: [Select]
;=================================================================
; Script Name: Resisting Spells
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: UO Legends
; Revision Date: 20/5/2009
; Purpose: Trains Resisting Spells 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
  while #mana >= %minManaToCast
  gosub castClumsy
gosub meditate
while #mana < #maxMana
  gosub checkMeditateStatus
until #charGhost = yes
return

sub setup
  set %userFcr 0
  chooseskill resi 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
  set %minManaToCast 3
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 CastClumsy
  if #targCurs = 1
  set #targCurs 0
  event macro 15 0 ; Cast Clumsy
  target
  event macro 23 ; Target Self
  wait 30
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 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
To learn, read.
To know, write.
To master, teach.

Tags: