Author Topic: Fishing 4x4 Harbor Edition Version 0.1 for Public Testing  (Read 3206 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
Fishing 4x4 Harbor Edition Version 0.1 for Public Testing
« on: May 15, 2009, 08:27:21 AM »
0
Fishing 4x4 Harbor Edition



This is a modification of my previous script Fishing 4x4, this time I cuted out the boat support in order to make the code easier to understand and improve.

Later on I will made another edition specific for boats.

The script works fine but I wanna post it here for a while before posting it on the Submit Your Script section, in case anyone has any suggestions about the code and how to improve it.

Purpose

  • Fishes in a harbor till you are overloaded

Current features

  • Fishes under the harbor's tables
  • If the sell option it's activated, sells the steaks using Razor Sells Agent (you have to set the Razor Agent to do this).
  • Cuts the fish with a dagger.
  • Drops boots on the ground.
  • Drops special fishes on the ground
  • If the saving data option it's activated, saves the fishing data in a file called fishing4x4DataHarbor.txt aproximately each 10 minutes

Version History

new in 0.1  (15/5/09)

  • Published the first script's version.

Posible Future Features

  • Add support for Runebooks in order to drop money and white pearls in the Bank

Notes

  • How fishing4x4DataHarbor.txt looks like, in case you activate this option:

Quote
Start Time: 16:07:48  | Start Gold: 5788
Time: 16:18:06 | Time Fishing: 00:10:18 | Gold: 5992 | Gold Gained: 204 | Gold Per Hour: 1188
Time: 16:31:20 | Time Fishing: 00:23:32 | Gold: 6216 | Gold Gained: 428 | Gold Per Hour: 1091
Time: 16:45:20 | Time Fishing: 00:37:32 | Gold: 6408 | Gold Gained: 620 | Gold Per Hour: 991


  • Explanation how the 4x4 fishing works extracted from here. Warning: This only works with RunUO or OSI shards, not with Sphere ones.

Quote
8x8 resource blocks are how UO handles resources that respawn.  Resources don't restock in a tile/tile basis.  So when you just fish in 4x4 blocks around you, you are depleting all possible resources by only fishing in 4 spots!

Actually it works out pretty close actually.  If you fish one 4x4 square to being empty, then the other 3, you are really close to having the resources replenished.  Trust me, I have a couple fishing scripts out there and have been doing the fishing thing for just about the beginning of my scripting life, so I've tweaked it a bunch.  It's all come to successful fishing attempts/hr so if you over-fish an area, you'll waste a lot of time in that same area knowing you won't fish anything up.

Instructions

  • You need wearing a pole in the paperdoll, you also need a dagger in the backpack.
  • %sellFishsteaks - set #true for sell the fish steaks or #false, it's #true by default. You need to add fishSteaks at the Razor's Sell Agent
  • %saveData - set #true for save data in fishing4x4DataHarbor.txt or #false, it's #true by default. You need the SaveTextToFile.vbs script for this. Important: Remember to rename it from .txt to .vbs
Code: [Select]
;=================================================================
; Script Name: Fishing 4x4 Harbor Edition
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: UO Legends
; Revision Date: 15/5/2009
; Purpose: Fishing in a harbor till you are overloaded
; Globals: None
;=================================================================
; Instructions:
; You need wearing a pole in the paperdoll, you also need a dagger
; in the backpack.
; %sellFishsteaks - set #true for sell the fish steaks or #false
;                   It's #true by default, you need to add fishSteaks
;                   at the Razor's Sell Agent
; %saveData - set #true for save data in fishing4x4DataHarbor.txt or #false
;             It's #true by default
;             You need the SaveTextToFile.vbs script for this
; %saveData - set #true for save data in fishing4x4Data.txt or #false
;             It's #true by default. You need the SaveTextToFile.vbs script for this.
;             Important: Remember to rename it from .txt to .vbs
; Thanks: TrailMyx for his ConvertTimeHourMinSec sub
;         JoMac for his saveTextToFile.vbs script
;************************ Setup **********************************
gosub setup
;*********************** Main Loop *******************************
repeat
  gosub fishingLoop
 
  gosub dropBoots
  gosub dropSpecialFishes
 
  if %saveData
    gosub saveData
until #CharGhost = YES
halt
;************************* Subs **********************************
sub setup
  set %sellFishSteaks #true
  set %saveData #true
 
  set %maxWeight 570
 
  set %poleType KDF
  set %daggerType WSF
 
  gosub setID poleID %poleType  #charID
  gosub setID daggerID %daggerType #backpackID
  if %saveData
    gosub saveStartData
return

sub setID
  finditem %2 C_ , %3
  set % . %1 #findID
return

sub saveStartData
  set %goldType POF
  set %startTime #scnt
  set %lastSave %startTime
  gosub time #time
  finditem %goldType C_ , #backpackID
  set %startGold #findStack
  gosub writeStartData
return

sub writeStartData
  execute SaveTextToFile.Vbs #false #false #curPath fishing4x4DataHarbor.txt
  + Start Time: %time |
  + Start Gold: %startGold
return

sub fishingLoop
  for %fishingSpot 1 4
  {
    gosub pullFishes %fishingSpot
    gosub cutFish
    if %sellFishSteaks
      gosub sellFishSteaks
  }
return

sub pullFishes
  gosub fishingSpot %1
  gosub tileName %fishingSpotX %fishingSpotY
  event sysmessage %fishingSpotX %fishingSpotY
  while #result = #true
  {
    gosub usePole
    gosub scanMessages
  }
return

sub fishingSpot
  set %fishingSpot %1
  if %fishingSpot = 1
    gosub setTargets 4 4
  if %fishingSpot = 2
    gosub setTargets 4 -4
  if %fishingSpot = 3
    gosub setTargets -4 4
  if %fishingSpot = 4
    gosub setTargets -4 -4
return

sub setTargets
  set %fishingSpotX %1
  set %fishingSpotY %2
  set #lTargetKind 2
  set #lTargetX #charPosX + %fishingSpotX
  set #lTargetY #charPosY + %fishingSpotY
return

sub tileName
  set %fishingPosX #charPosX + %1
  set %fishingPosY #charPosY + %2
  tile init
  tile cnt %fishingPosX %fishingPosY
  for %tileCount 1 #tilecnt
  {
    tile get %fishingPosX %fishingPosY %tileCount
    set #lTargetZ #tileZ
    set %canFish water in #tileName || jungle in #tileName
    if %canFish
      return #true
  }
return

sub UsePole
  set #lObjectID %poleID
  event macro 17
  target
  event macro 22
return

sub scanMessages
  set %maxTimeOutScan 15
  set %timeOut #scnt + %maxTimeOutScan
  set %jrnl #jindex
  set %successMessage pull_out
  set %failMessage fail_to_catch
  set %emptySpotMessage don't_seem_to_be_biting
  scanjournal %jrnl
 
  while #scnt < %timeOut
  {
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }
    set %spotWithFish %successMessage in #journal || %failMessage in #journal
    set %spotWithoutFish %emptySpotMessage in #journal
    if %spotWithFish
      return #true
    if %spotWithoutFish
      return #false
  }
return

sub dropBoots
  set %bootsType TVI_ZVI_ZVI_PVI_NVI
  finditem %bootsType C_ , #backpackID
  while #findKind <> -1
  {
    exevent drag #findID #findStack
    wait 1s
    exevent dropg #charPosX #charPosY #charPosZ
    wait 1s
    finditem %bootsType C_ , #backpackID
  }
return

sub dropSpecialFishes
  set %fishType YDF
  finditem %fishType C_ , #backpackID
  while #findKind <> -1
  {
    exevent drag #findID #findStack
    wait 1s
    exevent dropg #charPosX #charPosY #charPosZ
    wait 1s
    finditem %fishType C_ , #backpackID
  }
return

sub saveData
  if #scnt >= %lastSave + 600
  {
    set %timeFishing #scnt - %startTime
    gosub ConvertTimeHourMinSec %timeFishing
    set %timeFishingConverted #result
    set %lastSave #scnt
   
    finditem %goldType C_ , #backpackID
    set %gold #findStack
    set %goldGained %gold - %startGold
    set %goldPerHour ( %goldGained * 3600 ) / %timeFishing
   
    gosub time #time
    gosub writeData
  }
return

sub writeData
  execute SaveTextToFile.Vbs #false #false #curPath fishing4x4DataHarbor.txt
  + Time: %time |
  + Time Fishing: %timeFishingConverted |
  + Gold: %gold |
  + Gold Gained: %goldGained |
  + Gold Per Hour: %goldPerHour
return

sub cutFish
  set %fishType FQD_DQD_GQD_EQD
  set #lTargetKind 1
  set #lObjectID %daggerID
  finditem %fishType C_ , #backpackID
  while #findKind <> -1
  {
    set #lTargetID #findID
    event macro 17
    target
    event macro 22
    wait 1s
    finditem %fishType C_ , #backpackID
  }
return

sub sellFishSteaks
  if %sellFishSteaks
    gosub sell
  else
    gosub checkWeight
return

sub sell
  set %vendorType IS_HS
  set %fishSteaksType IND
  finditem %vendorType G_2
  event property #findID
  set %canSell Fisher in #property && #findDist <= 2
  while ! %canSell
  {
    wait 1s
    finditem %vendorType G_2
    event property #findID
    set %canSell Fisher in #property && #findDist <= 2
  }
  finditem %fishSteaksType C_ , #backpackID
  if #findKind <> -1
    msg vendor sell $
return

sub checkWeight
  if #weight > %maxWeight
    halt
return

sub time
  set %time %1
  str ins %time : 3
  set %time #strRes
  str ins %time : 6
  set %time #strRes
return

; %1 = input - Time to convert
; #RESULT -  Time converted to H:MM:SS format
sub ConvertTimeHourMinSec
  namespace push
  namespace local ctime
  set !hourpart %1 / 3600
  set !secpart ( %1 % 3600 ) % 60
  set !minpart ( ( %1 % 3600 ) / 60 )
 
  if !hourpart >= 10
    set #RESULT !hourpart , :
  else
    set #RESULT 0 , !hourpart , :
  if !minpart < 10
    set #RESULT #RESULT , 0
  set #RESULT #RESULT , !minpart , :
  if !secpart < 10
    set #RESULT #RESULT , 0
  set #RESULT #RESULT , !secpart
  namespace pop
return #RESULT

There are 2 attachment(s) in this post. You must register and post an acceptable introduction to download
SaveTextToFile.txt
fishing4x4Harbor.txt
« Last Edit: May 15, 2009, 08:43:33 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: Fishing 4x4 Harbor Edition Version 0.1 for Public Testing
« Reply #1 on: May 15, 2009, 10:07:14 AM »
0
Good deal!  Nice addition to the fishing line.  My first fishing script was also from the harbor, and didn't look as nice as yours.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Fishing 4x4 Harbor Edition Version 0.1 for Public Testing
« Reply #2 on: May 17, 2009, 10:34:44 AM »
0
I'm glad you like it.

So i'm working on support for runebooks, but I have found out that if you fish in profound waters the #ltargetKind it's 2 and if you fish in near the coast waters, the #lTargetKind it's 3

The question is, how can I find out the #lTargetKind of a water's tile?
To learn, read.
To know, write.
To master, teach.

Offline VicVegaTopic starter

  • Jr. Member
  • **
  • Posts: 71
  • Activity:
    0%
  • Reputation Power: 0
  • VicVega has no influence.
  • Respect: +8
  • Referrals: 0
    • View Profile
Re: Fishing 4x4 Harbor Edition Version 0.1 for Public Testing
« Reply #3 on: May 17, 2009, 12:34:07 PM »
0
Here is the script with runebook support, wich it's not complete yet but it works fine. I don't like much the new code and I have to think a way to find a more elegant and understandable solution.

Code: [Select]
;=================================================================
; Script Name: Fishing 4x4 Harbor Edition
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: UO Legends
; Revision Date: 15/5/2009
; Purpose: Fishing in a harbor till you are overloaded
; Globals: None
;=================================================================
; Instructions:
; You need wearing a pole in the paperdoll, you also need a dagger
; in the backpack.
; %sellFishsteaks - set #true for sell the fish steaks or #false
;                   It's #true by default, you need to add fishSteaks
;                   at the Razor's Sell Agent
; %saveData - set #true for save data in fishing4x4DataHarbor.txt or #false
;             It's #true by default
;             You need the SaveTextToFile.vbs script for this
; %saveData - set #true for save data in fishing4x4Data.txt or #false
;             It's #true by default. You need the SaveTextToFile.vbs script for this.
;             Important: Remember to rename it from .txt to .vbs
; %recall - set #true for recall, #true by default, uses sacred journey
; Thanks: TrailMyx for his ConvertTimeHourMinSec sub
;         JoMac for his saveTextToFile.vbs script
;************************ Setup **********************************
gosub setup
;*********************** Main Loop *******************************
repeat
  gosub fishingPlace
  gosub checkWeight
  gosub fishingLoop
  gosub dropBoots
  gosub dropSpecialFishes
 
  if %saveData
    gosub saveData
until #CharGhost = YES
halt
;************************* Subs **********************************
sub fishingPlace
  if %fishingPlace = firstFishingPlace
  {
    event sysmessage going to second fishing place
    set %fishingPlace secondFishingPlace
    gosub recallFishingSpot secondFishingPlace
  }
  else
  {
    event sysmessage going to first fishing place
    set %fishingPlace firstFishingPlace
    gosub recallFishingSpot firstFishingPlace
  }
return

sub setup
  set %sellFishSteaks #true
  set %saveData #true
  set %recall #true
  set %fishingPlace secondFishingPlace
 
  set %maxWeight #maxweight - 50
 
  set %poleType KDF
  set %daggerType WSF
 
  gosub setID poleID %poleType  #charID
  gosub setID daggerID %daggerType #backpackID
  if %saveData
    gosub saveStartData
return

sub setID
  finditem %2 C_ , %3
  set % . %1 #findID
return

sub saveStartData
  set %goldType POF
  set %startTime #scnt
  set %lastSave %startTime
  gosub time #time
  finditem %goldType C_ , #backpackID
  set %startGold #findStack
  gosub writeStartData
return

sub writeStartData
  execute SaveTextToFile.Vbs #false #false #curPath fishing4x4DataHarbor.txt
  + Start Time: %time |
  + Start Gold: %startGold
return

sub fishingLoop
  for %fishingSpot 1 4
  {
    gosub pullFishes %fishingSpot
    gosub cutFish
    if %sellFishSteaks
      gosub sellFishSteaks
  }
return

sub pullFishes
  gosub fishingSpot %1
  gosub tileName %fishingSpotX %fishingSpotY
  event sysmessage %fishingSpotX %fishingSpotY
  while #result = #true
  {
    gosub usePole
    gosub scanMessages
  }
return

sub fishingSpot
  set %fishingSpot %1
  if %fishingSpot = 1
    gosub setTargets 4 4
  if %fishingSpot = 2
    gosub setTargets 4 -4
  if %fishingSpot = 3
    gosub setTargets -4 4
  if %fishingSpot = 4
    gosub setTargets -4 -4
return

sub setTargets
  event sysmessage %fishingPlace
  if %fishingPlace = firstFishingPlace
    set #lTargetKind 2
  if %fishingPlace = secondFishingPlace
    set #lTargetKind 3
  set %fishingSpotX %1
  set %fishingSpotY %2
  set #lTargetX #charPosX + %fishingSpotX
  set #lTargetY #charPosY + %fishingSpotY
return

sub tileName
  set %fishingPosX #charPosX + %1
  set %fishingPosY #charPosY + %2
  tile init
  tile cnt %fishingPosX %fishingPosY
  for %tileCount 1 #tilecnt
  {
    tile get %fishingPosX %fishingPosY %tileCount
    set #lTargetZ #tileZ
    set #ltargetTile #tileType
    set %canFish water in #tileName || jungle in #tileName
    if %canFish
      return #true
  }
return

sub UsePole
  set #lObjectID %poleID
  event macro 17
  target
  event macro 22
return

sub scanMessages
  set %maxTimeOutScan 15
  set %timeOut #scnt + %maxTimeOutScan
  set %jrnl #jindex
  set %successMessage pull_out
  set %failMessage fail_to_catch
  set %emptySpotMessage don't_seem_to_be_biting
  scanjournal %jrnl
 
  while #scnt < %timeOut
  {
    if %jrnl < #jindex
    {
      set %jrnl %jrnl + 1
      scanjournal %jrnl
    }
    set %spotWithFish %successMessage in #journal || %failMessage in #journal
    set %spotWithoutFish %emptySpotMessage in #journal
    if %spotWithFish
      return #false
    if %spotWithoutFish
      return #false
  }
return

sub dropBoots
  set %bootsType TVI_ZVI_ZVI_PVI_NVI
  finditem %bootsType C_ , #backpackID
  while #findKind <> -1
  {
    exevent drag #findID #findStack
    wait 1s
    exevent dropg #charPosX #charPosY #charPosZ
    wait 1s
    finditem %bootsType C_ , #backpackID
  }
return

sub dropSpecialFishes
  set %fishType YDF
  finditem %fishType C_ , #backpackID
  while #findKind <> -1
  {
    exevent drag #findID #findStack
    wait 1s
    exevent dropg #charPosX #charPosY #charPosZ
    wait 1s
    finditem %fishType C_ , #backpackID
  }
return

sub saveData
  if #scnt >= %lastSave + 600
  {
    set %timeFishing #scnt - %startTime
    gosub ConvertTimeHourMinSec %timeFishing
    set %timeFishingConverted #result
    set %lastSave #scnt
   
    finditem %goldType C_ , #backpackID
    set %gold #findStack
    set %goldGained %gold - %startGold
    set %goldPerHour ( %goldGained * 3600 ) / %timeFishing
   
    gosub time #time
    gosub writeData
  }
return

sub writeData
  execute SaveTextToFile.Vbs #false #false #curPath fishing4x4DataHarbor.txt
  + Time: %time |
  + Time Fishing: %timeFishingConverted |
  + Gold: %gold |
  + Gold Gained: %goldGained |
  + Gold Per Hour: %goldPerHour
return

sub cutFish
  set %fishType FQD_DQD_GQD_EQD
  set #lTargetKind 1
  set #lObjectID %daggerID
  finditem %fishType C_ , #backpackID
  while #findKind <> -1
  {
    set #lTargetID #findID
    event macro 17
    target
    event macro 22
    wait 1s
    finditem %fishType C_ , #backpackID
  }
return

sub sellFishSteaks
  set %vendorType IS_HS
  set %fishSteaksType IND
  finditem %vendorType G_2
  event property #findID
  set %canSell Fisher in #property && #findDist <= 2
  while ! %canSell
  {
    wait 1s
    finditem %vendorType G_2
    if #findID = #charID
      ignoreitem #findID
    event property #findID
   
    set %canSell Fisher in #property && #findDist <= 2
  }
  ignoreitem reset
  finditem %fishSteaksType C_ , #backpackID
  if #findKind <> -1
    msg vendor sell $
return

sub checkWeight
 
  if #weight > %maxWeight
  {
    if %recall
    {
      gosub recallBank
      gosub dropItemsBank
      gosub recallFishingSpot
    }
    else
      halt
  }
return

sub recallBank
  set %bankPosX 3489
  set %bankPosY 2571
  set %runeNo 1
  set %recallType sacred
  call runeBook.txt %recallType %runeNo
  gosub waitingRecallPos %bankPosX %bankPosY recallBank
 
return

sub recallFishingSpot
  if %1 = firstFishingPlace
  {
    set %fishingPosX 3504
    set %fishingPosY 2610
    set %runeNo 2
  }
  if %1 = secondFishingPlace
  {
    set %fishingPosX 1503
    set %fishingPosY 3695
    set %runeNo 3
  }
  set %recallType sacred
  call runeBook.txt %recallType %runeNo
  gosub waitingRecallPos %fishingPosX %fishingPosY recallFishingSpot
 
return

sub waitingRecallPos
  set %maxTimeOut 5
  set %timeOut #scnt + %maxTimeOut
  while #charPosX <> %1 && #scnt < %timeOut
    wait 1s
  set %timeOut #scnt + %maxTimeOut
  while #charPosY <> %2 && #scnt < %timeOut
    wait 1s
  if #scnt >= %timeOut
    gosub %3
return

sub dropItemsBank
  set %bankType IKF
  set %goldType POF
  set %pearlsType WWS
  msg bank $
  while #contType <> %bankType
    wait 5
  gosub dropItems
  click #contPosX #contPosY r
  wait 1s
return

sub dropItems
  finditem %goldType C_ , #backpackID
  if #findKind <> -1
  {
    event sysmessage droping gold
    exevent drag #findID #findStack
    wait 1s
    finditem %bankType
    exevent dropC #findID
    wait 1s
  }
  finditem %pearlsType C_ , #backpackID
  if #findKind <> -1
  {
    event sysmessage droping pearls
    exevent drag #findID #findStack
    wait 1s
    finditem %bankType
    exevent dropC #findID
    wait 1s
  }
return

sub time
  set %time %1
  str ins %time : 3
  set %time #strRes
  str ins %time : 6
  set %time #strRes
return

; %1 = input - Time to convert
; #RESULT -  Time converted to H:MM:SS format
sub ConvertTimeHourMinSec
  namespace push
  namespace local ctime
  set !hourpart %1 / 3600
  set !secpart ( %1 % 3600 ) % 60
  set !minpart ( ( %1 % 3600 ) / 60 )
 
  if !hourpart >= 10
    set #RESULT !hourpart , :
  else
    set #RESULT 0 , !hourpart , :
  if !minpart < 10
    set #RESULT #RESULT , 0
  set #RESULT #RESULT , !minpart , :
  if !secpart < 10
    set #RESULT #RESULT , 0
  set #RESULT #RESULT , !secpart
  namespace pop
return #RESULT

I also use this other script for calling runebooks:

Code: [Select]
finditem ZBN C_ , #backpackID
gosub runeBookDo %1 %2 #findID
exit

;==================================
; Script Name: RuneBookDo
; Author: Vito
; Version: 1.0a
; Client Tested with: 6.0.13 (91)
; EUO version tested with: 1.5 (148)
; Shard OSI / FS: FS ( RunUO ) Should work on OSI
; Revision Date: 13/04/2009
; Public Release: 13/04/2009
; Purpose: Handles most runebook functions
;==================================
;|
;| Parameters:
;|            %1 - "Do" ( setdefault  - Set default rune
;|                        drop        - Drop rune
;|                        charge      - Use charge on rune
;|                        recall      - Recall to rune
;|                        gate        - Open a gate to rune
;|                        sacred      - Sacred J. to rune )
;|            %2 - "Rune" ( Rune number, 1 to 16 )
;|            %3 - "Book" ( Runebook ID )
;|            [%4] - "TimeOut" ( Optional, sets timeout for
;|                               event based actions, in seconds )
;|
;| Return: #True if ok, else #False
;+-----------------------------------------------------------

sub RuneBookDo
    set %RBD_Do %1
    set %RBD_Rune %2 - 1
    set %RBD_Book %3

    ; Some security checks
    if %0 = 4
      set %RBD_TimeOut %4
    else
      set %RBD_TimeOut 10
    set %RBD_End #SCnt + %RBD_TimeOut

    if %0 < 3
      return #False

    if %RBD_Rune < 0 || %RBD_Rune > 15
      return #False

    ; Open the book
    finditem ZBN C_ , #BackPackID
    set #LObjectID #FindID
    event macro 17
    while #ContKind <> GJZ && %RBD_End > #SCnt
      wait 1

    if %RBD_Do = charge
    {
      set %RBD_X #ContPosX + 135
      if %RBD_Rune > 7
        set %RBD_X #ContPosX + 295
      ; Rather complex, uh?
      set %RBD_Y #ContPosY + 70 + ( 15 * ( %RBD_Rune % 8 ) )
    }
    else
    {
      ; Open the right page
      set %RBD_Page ( %RBD_Rune / 2 ) + 1
      if %RBD_Page < 5
        set %RBD_Page %RBD_Page - 1
      set %RBD_X #ContPosX + 140 + ( 35 * %RBD_Page )
      set %RBD_Y #ContPosY + 200
      click %RBD_X %RBD_Y dmc
      ; Unable to do event-based without using #PixCol (Puah!)
      wait 10

      if %RBD_Do = setdefault
      {
        set %RBD_X #ContPosX + 165 + ( 140 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 25
      }
      if %RBD_Do = drop
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 120
      }
      if %RBD_Do = recall
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 145
      }
      if %RBD_Do = gate
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 163
      }
      if %RBD_Do = sacred
      {
        set %RBD_X #ContPosX + 140 + ( 160 * ( %RBD_Rune % 2 ) )
        set %RBD_Y #ContPosY + 181
      }
    }
    click %RBD_X %RBD_Y dmc
return #True
« Last Edit: May 17, 2009, 12:36:20 PM by VicVega »
To learn, read.
To know, write.
To master, teach.

Tags: