[EasyUO] Fil's Runeviewer

If you make a Client-side script you can publish it here for other players to use
Locked
Filraen
Apprentice Scribe
Posts: 14
Joined: Tue Oct 01, 2013 4:07 am

[EasyUO] Fil's Runeviewer

Post by Filraen »

my first Script

Haven't writen it on myself, just merged a few together.....

Features:
2 different Menu's Choices (vertical or horizontal)
Can store all your Runebooks.
4 different Spells:
___Recall
___Gate Travel
___Sacred Journey
___Nature's Passage
All by one click

Image

Add Runebook's per Button.
F10 to delete one targeted Book.
Will auto adopt all Rune Names if you have this .txt file in your easyuo Folder.(exept Magda Runes)
http://www.easyuo.com/forum/viewtopic.p ... highlight=

If you find something not working or anything else let me know.

Sry for spelling, it 's late...............

Filraen [DLG]

Version 1.0 - 21.11.13
Version 1.1 - 22.11.13

Code: Select all

        ;===================================================
        ; Script Name: Rune book viewer
        ; Author:  Filraen Rilyntar
        ; Version:  1.1
        ; Client Tested with:  5.0.8b
        ; EUO version tested with: 1.5
        ; FS: Exelsior
        ; Revision Date: ----
        ; Public Release:  21/11/13
        ; Global Variables Used: *LL_method_selection, *LL_ , #runebookID's.
        ; Purpose: Loads rune books into a menu for 1 spot recalling.
        ;===================================================
        ;Thanks to Locke who wrote the first part of the Skript
        ;Thanks to BlaZe who wrote the runebook sub and Kal In Ex for your OCR sub

        Set %view wide ; you can also use long

        ; change the below var to #false to disable the hotkey
        set %enable_delete #true
        set %delete_key F10

        ; change the below var to #false to disable the hotkey
        set %enable_refresh #false
        set %REFRESH F9

        set #lpc 40
        set %combo_count 0
        namespace local LL_rune_viewer
        gosub INIT_vars
        gosub load_menu %view


                      ======================================================================
        Main_loop
        ;=================================================================
        While #TRUE
        {
        if #menubutton = long || #menubutton = wide
         gosub load_menu #menubutton

        if #menubutton = Add
         gosub add

        if %enable_delete = #true
        {
         ONHOTKEY %delete_key
         {
         set #lpc 10000
         set #targcurs 1
         display ok Please target the book now you wish to delete from memory.
          while #targcurs = 1
          wait 1
         if *LL . #ltargetid <> N/A
         set *LL . #ltargetid N/A
         ignoreitem reset temp
         namespace clear
         gosub INIT_vars
         gosub load_menu %view
         set #lpc 40
         }
        }

        if %enable_refresh = #true
        {
         ONHOTKEY %REFRESH
         {
          ignoreitem reset temp
          namespace clear
          gosub INIT_vars
          gosub load_menu %view
         }
        }

        if #menubutton <> N/A && #menubutton <> long && #menubutton <> wide && #menubutton <> add && #menubutton <> CLOSED
        {
         set #lpc 1000
         set %temp_book !A1
         if %temp_book <> N/A
         {
         menu get Recall_method
         if #menures = 2
         set !recall_method R
         if #menures = 3
         set !recall_method G
         if #menures = 4
         set !recall_method C
         if #menures = 5
         set !recall_method S
         if !recall_method = N/A
         set !recall_method R
         gosub UseRunebook %temp_book #menubutton !recall_method
         }
         else
         display ok You haven't chosen a location!
        set #menubutton N/A
        set #lpc 40
        }


        if #menubutton = CLOSED
        halt

        gosub check_status
        wait 1
        }
        halt

                     ======================================================================
        sub check_status
        ;=================================================================
        finditem ZBN ; runebook type
        if #findkind <> -1
        {
        for #findindex 1 #findcnt
        {
         if #findid IN *LL . #findid && #findid NOTIN !CURRENTLY_LOADED
         {
          set !CURRENTLY_LOADED !CURRENTLY_LOADED , _ , #findid
          gosub parse *LL . #findid _ N/A
          gosub update_menu COMBO_Button
         }
         else
         ignoreitem #findid temp
        }
        }
        menu get Recall_method
        if *LL_method_selection <> #menures && #menures <> N/A
        set *LL_method_selection #menures

        menu get Main
        if #menures <> %current_combo
        {
        if #menures > 0
        {
        set %current_combo #menures
        set !bug !COMBO_DATA . #menures
        gosub parse *LL . !bug _ N/A
        gosub update_menu BUTTON SETUP
        set %temp_book !A1
        }
        }
        return
                     ======================================================================
        sub update_menu
        ;=================================================================
        if COMBO IN %1
        {
        set !combo_count !combo_count + 1
        set !Combo_data , !combo_count !A1 ;rune IDs
        set !Combo_names , !combo_count !A2 ; names for the actual combo list
        set !CURRENTLY_LOADED !CURRENTLY_LOADED , _ , %temp_book
        set %current_combo !combo_count
        }

        if BUTTON IN %1 || %1 = N/A
        {
        menu font color black
        if %2 <> SETUP
        {
        menu combo add Main !A2
        menu combo select main !combo_count
        }
        set %temp_book !A1

        for %i 1 22
        {
        set !ii %i + 2
        menu set %i !A . !ii
        }

        Menu window Title Fil's Runeviewer - Currenting browsing !A2
        }
        return


                     ======================================================================
        sub add
        ;=================================================================
        ignoreitem reset temp
        set #targcurs 1
        target 2s
        display ok Please target the new rune book now.
        while #targcurs = 1
        wait 1
        set #lobjectid #ltargetid
        event macro 17 0
        set %temp_book #ltargetid
        gosub load_menu Edit_fields
        event property %temp_book
        for %i 1 10
        set !A . %i
        gosub parse #property $ N/A
        for %i 10 1
        {
        str len !A . %i
        if #strres > 0
        {
        menu set E0 !A . %i
        break
        }
        }
        while #menubutton = N/A
        wait 1
        if #menubutton = UseKalOCR
        {
         gosub addKalOCR
         set #menubutton N/A

         while #menubutton = N/A
         wait 1
        }

        set #menubutton N/A
        menu get E0
        str len #menures
        if #strres < 1
        {
        Display ok Please type in a name for the book and click save again.
        while #menubutton = N/A
        wait 1
        }

        if #menubutton = CLOSED
        halt

        set !thing N/A
        for %i 0 16
        {
        menu get E . %i
        set !II %i + 2
        set !A . !ii #menures
        set !B . %i #menures
        if !thing = N/A
        set !thing !B . %i
        else
        set !thing !thing , _ , !B . %i
        }
        gosub load_menu %view
        set *LL , %temp_book %temp_book , _ , !thing
        set !A1 %temp_book ; since how i parse out the name of the book %A1 gets set N/A and can cause problems later on

        if #contsize = 452_236
        {
        set !clickx #contposx + 200
        set !clicky #contposy + 20
        click !clickx !clicky R X_2
        }
        menu combo select main !combo_count
        gosub update_menu COMBO_BUTTON
        return


                     ======================================================================
        sub addKalOCR
        ;=================================================================
        ; Sub written by Kal In Ex
        ; TEST FOR THE PRESENCE OF KALOCR.TXT AT #CURPATH

        call #curpath , KalOCR.txt TestKalOCR
        if #result <> kalocr
        {
        display yesno
        + download KalOCR.txt from EasyUO.com and copy the file to the
        +$installation directory of EasyUO (the location of euox.exe).
        +$Clicking yes will open a browser window to a post at EasyUO.com
        +$where you can download KalOCR.txt
        if #dispres = yes
        execute http://www.easyuo.com/forum/viewtopic.php?t=3891&highlight=
        return
        }

        namespace push
        namespace local addKalOCR

        ; OPEN/RE-OPEN THE RUNEBOOK IF IT IS NOT IN FOCUS (SHOWN BY #CONT VARS)

        while #contsize <> 452_236
          {
          set #lobjectid %temp_book
          event macro 17 0
          for !_ 60 1
          {
          if #contsize = 452_236
          break
          wait 1
          }
          }

        ; POSITION THE RUNEBOOK AT A CONSTANT POSITION

        contpos 150 200
        wait 10

        ; GET THE RUNECOUNT AND LOAD THE NAMES IN THE MENU
        ; note: values for these 2 routines return in %1 not #result

        call #curpath , KalOCR.txt GetRuneCount 150 200
        set !RuneCount %1
        for !RuneIndex 1 !RuneCount
        {
        call #curpath , KalOCR.txt GetRuneName !RuneIndex 150 200
        set !RuneName %1
        menu set E , !RuneIndex !RuneName
        }
        namespace clear
        namespace pop
        return

                     ======================================================================
        sub parse
        ;=================================================================
        ; A1 = bookid, A2 = book name, from there it's the rune names...
        ; set %tempbook %A1
        ; set %currently_loaded %currently_loaded , _ , %tempbook
        ; if %tempbook notin %currently_loaded
        ; menu combo add %A2

        set !string %1
        str count !string %2
        set !vars #strres + 1

        if %3 = N/A
        set %3 !vars

        for %i 1 %3
        {
        str pos !string %2
        set !pos #strres
        str len !string
        set !len #strres
        str del !string !pos !len
        set !A , %i #strres
        str del !string 1 !pos
        set !string #strres
        }
        return


                      ======================================================================
        sub INIT_vars
        ;=================================================================
        set #lpc 1000
        set !combo_count 0
        set !CURRENTLY_LOADED N/A
        if %current_combo = 0 || %current_combo = N/A
        set %current_combo 1

        finditem ZBN ; runebook type
        if #findkind <> -1
        {
         for #findindex 1 #findcnt
         {
          if #findid IN *LL . #findid && #findid NOTIN !CURRENTLY_LOADED ; if the rune book has been previously recorded load its info, unless the info is already loaded.
          {
           set !CURRENTLY_LOADED !CURRENTLY_LOADED , _ , #findid
           gosub parse *LL . #findid _ 2
           set !combo_count !combo_count + 1
           set !Combo_data , !combo_count !A1 ;runebook ID
           set !Combo_names , !combo_count !A2 ; names for the actual combo list
          }
         }
        }
        if %current_combo => !combo_count
        set %current_combo %current_combo - 1

        set !bug !COMBO_DATA . %current_combo
        gosub parse *LL . !bug _ N/A
        gosub update_menu BUTTON SETUP

        set #lpc 100
        return


                      ======================================================================
        ;--------- EasyUO Menu Designer Code Begin ---------
        ;=================================================================
        sub load_menu
        if !A1 = N/A
        {
         for %i 1 18
         set !A . %i Not , #spc , available
        }

        set #menubutton N/A
          menu Clear
          menu Window Title Fil's Runeviewer
          menu Window Color Btnface
          menu Font Transparent #true
          menu Font Align Right
          menu Font Name MS Sans Serif
          menu Font Color Black
          menu Font Size 8
          menu Font Style
          menu Font black
         if %1 = long
         {
         set %view long
           menu Window Size 169 345
          menu Combo Create Main 12 4 145 Select a book
          menu Button 1 4 32 75 25 !A3
          menu Button 2 4 64 75 25 !A4
          menu Button 3 4 96 75 25 !A5
          menu Button 4 4 128 75 25 !A6
          menu Button 5 4 160 75 25 !A7
          menu Button 6 4 192 75 25 !A8
          menu Button 7 4 224 75 25 !A9
          menu Button 8 4 256 75 25 !A10
          menu Button 9 88 32 75 25 !A11
          menu Button 10 88 64 75 25 !A12
          menu Button 11 88 96 75 25 !A13
          menu Button 12 88 128 75 25 !A14
          menu Button 13 88 160 75 25 !A15
          menu Button 14 88 192 75 25 !A16
          menu Button 15 88 224 75 25 !A17
          menu Button 16 88 256 75 25 !A18
          menu Button Wide 4 288 75 25 Change view
          menu font style B
          menu Button Add 82 288 87 25 Add new book
          menu combo Create Recall_method 4 320 165 4
        }
        if %1 = wide
        {
        set %view Wide
          menu Window Size 612 86
          menu Combo Create Main 4 6 150 Select a book
          menu Button 1 4 32 75 25 !A3
          menu Button 2 80 32 75 25 !A4
          menu Button 3 156 32 75 25 !A5
          menu Button 4 232 32 75 25 !A6
          menu Button 5 308 32 75 25 !A7
          menu Button 6 384 32 75 25 !A8
          menu Button 7 460 32 75 25 !A9
          menu Button 8 536 32 75 25 !A10
          menu Button 9 4 60 75 25 !A11
          menu Button 10 80 60 75 25 !A12
          menu Button 11 156 60 75 25 !A13
          menu Button 12 232 60 75 25 !A14
          menu Button 13 308 60 75 25 !A15
          menu Button 14 384 60 75 25 !A16
          menu Button 15 460 60 75 25 !A17
          menu Button 16 536 60 75 25 !A18
          menu Button Long 156 4 75 25 Change view
          menu font style B
          menu Button Add 232 4 90 25 Add new book
          menu combo Create Recall_method 465 4 145 4
        }

        if %1 = Long || %1 = wide
        {
          menu combo Add Recall_method Select travel method
          menu combo Add Recall_method Recall
          menu combo Add Recall_method Gate
          menu combo Add Recall_method Sacred Journey
          menu combo Add Recall_method Nature's Passage
          if *LL_method_selection = N/A
          set *LL_method_selection 1
          menu combo select Recall_method *LL_method_selection
        }

        if %1 = Edit_fields
        {
          menu Window Size 389 321
          menu Font Size 12
          menu Font Align Left
          ;---------------------
          menu Text BookID 8 4 BookID:
          menu Text ID 124 4 %temp_book
          menu Text Name 8 32 Name of book:
          menu Text Rune 8 60 Rune number:
          menu Font Size 8
          menu Font BGColor Window
          menu Edit E0 120 32 121
          menu Edit E1 120 60 121
          menu Edit E2 120 88 121
          menu Edit E3 120 116 121
          menu Edit E4 120 144 121
          menu Edit E5 120 172 121
          menu Edit E6 120 200 121
          menu Edit E7 120 228 121
          menu Edit E8 120 256 121
          menu Edit E9 256 60 121
          menu Edit E10 256 88 121
          menu Edit E11 256 116 121
          menu Edit E12 256 144 121
          menu Edit E13 256 172 121
          menu Edit E14 256 200 121
          menu Edit E15 256 228 121
          menu Edit E16 256 256 121
          menu Font BGColor BtnFace
          menu Button useKalOCR 8 88 105 29 Use KalOCR
          menu Button Save 16 288 363 29 Save
        }
        If !combo_count > 0
        {
         for %i 1 !combo_count
         menu combo add main !combo_names . %i
         if %current_combo <> N/A
         menu combo select main %current_combo
         else
         menu combo select main 1
        }
        menu Show
        return



        ; BlaZin' Runebook
        ; by BlaZe Budd of Excelsior's ßud ßrothers
        ; edited by Filraen

        sub UseRunebook
        ignoreitem reset
        set !runebook %1
        set !index %2
        set !method %3
        set !fails = 0

        gosub spot
        gosub cast
        return
        ;;;;;;;;;;;;;;;;;;;;;;;;;

        ;;; Find and open the runebook ;;;
        sub openBook
        set #lobjectid !runebook
        event macro 17 0

       gosub waitForBook
        if pass in #result
          return

        ;;; Waits for runebook to open ;;;
        sub waitForBook
        loop:
        gosub journal You_must_wait
        if #result = fail
          return
        if #contSize = 452_236
          return pass
        goto loop
        ;;;;;;;;;;;;;;;;;;;;;;;;;

        ;;; Choosing the selected spot ;;;
        sub pageFlippin
        wait 10
        savepix ( #contposX + 135 ) ( #contPosY + 25 ) 1
        set %Y #contPosY + 200
        if %page = 1
          set %X #contPosX + 140
        if %page = 2
          set %X #contPosX + 175
        if %page = 3
          set %X #contPosX + 210
        if %page = 4
          set %X #contPosX + 245
        if %page = 5
          set %X #contPosX + 310
        if %page = 6
          set %X #contPosX + 345
        if %page = 7
          set %X #contPosX + 380
        if %page = 8
          set %X #contPosX + 415
        click %X %Y
        flip:
        cmpPix 1 t
          goto flip
        set %Y #contPosY + 25
        if %side = left
          set %X #contPosX + 165
        if %side = right
          set %X #contPosX + 305
        click %X %Y
        gosub waitForBook
        click %X %Y r
        return
        ;;;;;;;;;;;;;;;;;;;;;;;;;

        ;;; Casting ;;;
        sub cast
        gosub openBook
        gosub pageFlippin
              if !method = c
                event macro 1 0 [cs sacredjourney
              if !method = r
                event macro 1 0 [cs recall
              if !method = g
                event macro 1 0 [cs gatetravel
              if !method = s
                event macro 1 0 [cs NaturesPassage

        ;finditem %runeBook C_ , #backPackID
        set #lTargetID !runebook
        set #lTargetKind 1
        target
        event macro 22 0
        return
        ;;;;;;;;;;;;;;;;;;;;;;;;;

        ;;; Setting %side and %page ;;;
        sub spot
        if #menubutton = 1
          set %spot 1
        if #menubutton = 3
          set %spot 3
        if #menubutton = 5
          set %spot 5
        if #menubutton = 7
          set %spot 7
        if #menubutton = 9
          set %spot 9
        if #menubutton = 11
          set %spot 11
        if #menubutton = 13
          set %spot 13
        if #menubutton = 15
          set %spot 15
        if #menubutton = 2
          set %spot 2
        if #menubutton = 4
          set %spot 4
        if #menubutton = 6
          set %spot 6
        if #menubutton = 8
          set %spot 8
        if #menubutton = 10
          set %spot 10
        if #menubutton = 12
          set %spot 12
        if #menubutton = 14
          set %spot 14
        if #menubutton = 16
          set %spot 16


          if %spot = 1
           set %page 1
          if %spot = 3
           set %page 2
          if %spot = 5
           set %page 3
          if %spot = 7
           set %page 4
          if %spot = 9
           set %page 5
          if %spot = 11
           set %page 6
          if %spot = 13
           set %page 7
          if %spot = 15
           set %page 8
            set %side left

          if %spot = 2
           set %page 1
          if %spot = 4
           set %page 2
          if %spot = 6
           set %page 3
          if %spot = 8
           set %page 4
          if %spot = 10
           set %page 5
          if %spot = 12
           set %page 6
          if %spot = 14
           set %page 7
          if %spot = 16
           set %page 8
          if %spot / 2 = %page
          set %side right
        return
        ;;;;;;;;;;;;;;;;;;;;;;;;;
Last edited by Filraen on Thu Nov 21, 2013 6:46 pm, edited 1 time in total.
Dain Ironwill
Apprentice Scribe
Posts: 11
Joined: Wed Feb 22, 2012 2:26 pm

Re: [EasyUO] Fil's Runeviewer

Post by Dain Ironwill »

looks very interesting i will give it a go later.
Locked