Author Topic: TrailMyx's Active Meditation Subs  (Read 4109 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • 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
TrailMyx's Active Meditation Subs
« on: May 02, 2009, 12:56:56 PM »
0
Just some subs to handle your meditation needs.

Code: easyuo
  1. ;-----------------------------------------------------------
  2. ; Script Name: TrailMyx's Active Meditation Subs
  3. ; Author: TrailMyx
  4. ; Version: 1.1
  5. ; Client Tested with: 6.0.1.6
  6. ; EUO version tested with: 1.5 118
  7. ; Shard: OSI, FS
  8. ; Revision Date:  6/15/2007
  9. ; Public Release: ...
  10. ; Global Variables Used: None
  11. ; Purpose/Features:
  12. ;   Automatic active meditation
  13. ; Usage:
  14. ;   gosub Meditate #TRUE 10 ; call block until mana reaches #INT - 10
  15. ;   gosub Meditate #FALSE 10 ; just startes active meditation, then returns.
  16. ;
  17. ;    http://www.scriptuo.com/
  18. ;----------------------------------------------------------
  19. ; %1 #TRUE = wait until you've reached your threshold
  20. ; %2 = target full threshold (number subtracted from #INT)
  21. sub Meditate
  22.   namespace push
  23.   namespace local MED
  24.   set !wait %1
  25.   set !thresh %2
  26.   gosub TM_SyncTextScan
  27.   set !mana_target #INT - !thresh
  28.   set !success #FALSE
  29.   med_loop1:
  30.     if #MANA > !mana_target
  31.       goto Meditate_skip
  32.     if !success = #FALSE
  33.     {
  34.       gosub TM_SyncTextScan
  35.       event macro 13 46
  36.       wait 20
  37.     }
  38.     gosub TM_FindValidTextNoAdvance you_enter_a_meditative_trance
  39.     if #RESULT = #TRUE
  40.     {
  41.       gosub TM_SyncTextScan
  42.       if !wait <> #TRUE
  43.         goto Meditate_skip
  44.       set !success #TRUE
  45.     }
  46.     gosub TM_FindValidTextNoAdvance you_stop_meditating
  47.     if #RESULT = #TRUE
  48.     {
  49.       gosub TM_SyncTextScan
  50.       set !success #FALSE
  51.     }
  52.     goto med_loop1
  53. Meditate_skip:
  54.   namespace pop
  55. return
  56. ;-------------------------------------------------------------------------------
  57. ; Brings !_jindex up to the most recent #journal entry
  58. sub TM_SyncTextScan
  59.   namespace push
  60.   namespace local text
  61.   set !_jindex #jindex + 1
  62.   namespace pop
  63. return
  64. ;-------------------------------------------------------------------------------
  65. ; %2, %3, %4, etc strings to match
  66. ; returns #TRUE for match, #FALSE for no match
  67. ;  Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
  68. ;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
  69. sub TM_FindValidTextNoAdvance
  70.   namespace push
  71.   namespace local text
  72.   set !temp_lpc #LPC
  73.   set #LPC 1000
  74.   set !num_args %0
  75.   set !first_arg 1
  76.   if !_jindex = N/A
  77.     set !_jindex #jindex
  78.   set !index !first_arg
  79.   repeat
  80.     set !temp_jindex !_jindex
  81.     set !text % . !index
  82.     while !temp_jindex <= #jindex
  83.     {
  84.       scanjournal !temp_jindex
  85.       if !text in #journal && :_ , !text notin #journal
  86.       {
  87.         set !temp_jindex !temp_jindex + 1
  88.         set #LPC !temp_lpc
  89.         namespace pop
  90.         return #TRUE
  91.       }
  92.       set !temp_jindex !temp_jindex + 1
  93.     }
  94.     set !index !index + 1
  95.   until ( ( !index - !first_arg ) > ( !num_args - 1 ) )
  96.   set #LPC !temp_lpc
  97.   namespace pop
  98. return #FALSE
  99.  
  100.  
« Last Edit: May 05, 2017, 05:02:23 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: TrailMyx Snippet