Author Topic: Fishing sub  (Read 7596 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
Re: Fishing sub
« Reply #15 on: April 20, 2009, 08:14:03 AM »
0
Quote
but if you stand anywhere in an 8x8 resource block and fish 4 spaces in any direction

4 spaces in any direction?, wasn't the point to try to only fish in one spot for each 4x4 set?, ergo, the 4 spaces shouldn't be random spots in any direction ...

So for fishing:

(-4,4) and then (-4,3) = wrong because there is no more fish after fishing in (-4,4), both spots are in the same 4x4 and 8x8 set

(-4,4) and then (4,4) = right because it's a different 4x4 set

Is this correct?
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 sub
« Reply #16 on: April 20, 2009, 08:27:48 AM »
0
Ya, right.  You definitely want to make your fishing attempt at the maximum distance in a direction (>=4).  If you are fishing at +/-4, you are really covering a 9x9 box (-4...0...4) so this will lead to you fishing across to the next resource grids in each direction.

Again, you might want to verify this is in fact how it functions on your particular shard.
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 sub
« Reply #17 on: April 20, 2009, 09:35:38 AM »
0
I really don't get the logic about it but I think I can make it work now.



I hope it's more or less like I think.  :-\
« Last Edit: April 20, 2009, 09:39:27 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 sub
« Reply #18 on: April 20, 2009, 09:40:06 AM »
0
Nothing quite describes logic like code, so take a look at what's implemented in the fisherman here.  ;)
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 sub
« Reply #19 on: April 20, 2009, 10:25:28 AM »
0
I give up. I made a script that does exactly like in the pic, but it happened what I thought It would happen, instead of what I like it would happen ...

So, fish in -4 4 spot, after fishing a couple times it's deplenish, then fish on 4 4, and same with -4 -4 and 4 -4.

After fishing in those four spots (like 2 - 3 min, and some fishes ), there is no more fish and if it respawns every hour, what the hell do I do meanwhile?

It's not the complete code because it's too long.

Code: [Select]
sub fishing
  for %i 1 4
  {
      if #contkind = ORLB
        call %pathReconnect
      if #weight > %maxweight
         return
       gosub fishingSpot %i
       event sysmessage %1 %2
       gosub usePole
       gosub scan

      wait 5
      deletejournal
      gosub pickupFish
  }
return

sub fishingSpot

  if %1 = 1
    gosub setTargets 4 4

  if %1 = 2
     gosub setTargets 4 -4

  if %1 = 3
    gosub setTargets -4 4

  if %1 = 4
    gosub setTargets -4 -4
return

sub setTargets
    set #lTargetKind 2
    set #LTARGETX #CHARPOSX + %1
    set #LTARGETY #CHARPOSY + %2
return

So I don't think I can improve my fish rate this way.  :'(

My fishdata.txt (generated from my fish script, without improvements but works fine)

Quote
Time: 13:06:09
Initial Gold: 109309
Initial skill: 1122

Time: 13:19:12
Time fishing: 781 s 13 min
Total time fishing: 781 s 13 min
Gold: 110415
Gold Gain: 1106
Total Gold Gain: 1106
Skill: 1122
Skill Gain: 0


Time: 13:33:36
Time fishing: 852 s 14 min
Total time fishing: 1633 s 27 min
Gold: 111392
Gold Gain: 957
Total Gold Gain: 2063
Skill: 1122
Skill Gain: 0

...
« Last Edit: April 20, 2009, 10:30:21 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 sub
« Reply #20 on: April 20, 2009, 10:29:54 AM »
0
Ouch.  1 hr respawn is just harsh.  How committed are you to the shard you're on?  Those are the kinds of things that make me start looking for something a bit more reasonable. 

Did you determine if the fish are at each square, or distributed in an 8x8 area?
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 sub
« Reply #21 on: April 20, 2009, 10:43:24 AM »
0
It might be a Sphere thing I suppose, I'm sure it works fine in OSI and RunUO. I prefer to move on to another scripts, and thanks for the help, I learned things trying to solve this.

This is the script I'm currently using to fish, in case anyone wants to see how it works:

Code: [Select]
;=================================================================
; Script Name: Fishing Script
; Author: VicVega
; Version: 0.1
; Shard OSI / FS: FS EpsilonUO
; Revision Date: 15/4/2009
; Purpose: Fish, sells the fish, and fish again
; Globals: None
;=================================================================

;************************ Setup **********************************
gosub setup
;*********************** Main Loop *******************************
repeat
  if #contkind = ORLB
    call %pathReconnect
  else
  {
    set %initialRoundTime #scnt
    set %initialRoundGold #gold + %goldCorrection
    set %initialRoundSkill #skill
    call eatFood.txt
    gosub fishingPos
    call hidingSub.txt
    gosub fishing
    gosub dropFish
    gosub sell
    gosub saveData
    call saveMoney.txt
  }
 
  while #CharGhost = YES
        wait 0
until #CharGhost = YES

;************************* Subs **********************************
sub setup
set %fishType GQD_TLW_VLW_DMW_LGW_NGW_GMW_FQD_OGW_WLW_
+YLW_DQD_SLW_ULW_FMW_EMW_XLW_RLW_EQD_NMW
set %poleType NSL_KSL
set %pathReconnect reconnect.txt
set %maxTimeOutScan 15
set %maxTilesToWalk 23
set %maxweight #maxweight - 15
set %vendorPosX 1372
set %vendorPosY 3894
set %vendorID PTGB
set %charPosX 1372
set %charPosY 3895
set %goldCorrection 131072
set %fishingLocation = 1
set %path c:\euo\ ; Easy UO scripts path
chooseSkill Fish
gosub dataSetup
return

sub badSpots
if ( ( %x = -6 && -6 >= %y <= -3 ) || ( %x = -6 && 3 >= %y <= 6 ) || ( %x = -5 && -6 >= %y <= -5 )
   + || ( %x = -5 && 6 >= %y <= 5 ) || ( %x = -4 && %y = -6 ) || ( %x = -4 && %y = 6 )
   + || ( %x = -3 && %y = -6 ) || ( %x = -3 && %y = 6 ) || ( %x = -1 && %y = -6 )
   + || ( %x = -1 && 1 >= %y <= -1 ) || ( %x = -1 && %y = 6 ) || ( %x = 0 && %y = -6 )
   + || ( %x = 0 && 1 >= %y <= -1 ) || ( %x = 0 && %y = 6 ) || ( %x = 1 && %y = -6 )
   + || ( %x = 1 && 1 >= %y <= -1 ) || ( %x = 1 && %y = 6 )
   + || ( %x = 3 && %y = -6 ) || ( %x = 3 && %y = 6 ) || ( %x = 4 && %y = -6 ) || ( %x = 4 && %y = 6 )
   + || ( %x = 5 && -6 >= %y <= -5 ) || ( %x = 5 && 6 >= %y <= 5 )
   + || ( %x = 6 && -6 >= %y <= -3 ) || ( %x = 6 && 3 >= %y <= 6 ) )
     return #false
return #true

sub fishing
  for %x -6 6
  {
    for %y -6 6
    {
      if #contkind = ORLB
        call %pathReconnect
      if #weight > %maxweight
         return
      gosub badSpots
      while #result = #true
      {
       gosub usePole
       gosub scan
      }
      wait 5
      deletejournal
      gosub pickupFish
    }
  }
return

sub sell
move %vendorPosX %vendorPosY 0 60s
finditem %vendorID
if #findkind <> -1
  move #findx #findy 1 60s
call sellSub.txt
return

sub fishingPos
set %random #random % %maxTilesToWalk
set %newPosY %charPosY + %random
move %charPosX %newPosY  0 60s
return

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

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

  if ( mala_suerte in #journal || Pescaste in #journal )
    return #true

  if ( no_hay_peces in #journal || mejor_pesca in #journal )
    return #false
}

if #targCurs = 1
  set #targCurs 0
}
return

sub UsePole
set #lTargetKind 2
set #lTargetX #CHARPOSX + %x
set #lTargetY #CHARPOSY + %y
finditem %poleType
set #LOBJECTID #FINDID
event macro 17
target 3s
event macro 22
return

sub pickUpFish
finditem %fishType G_2
if #findkind <> -1
  call pickupFish.txt
return

sub dataSetup
set %totalGoldGain 0
set %totalTime 0
set %initialGold #gold + %goldCorrection
set %initialTime #time
set %initialSkill #skill

execute SaveTextToFile.Vbs #false #false %path fishingData.txt
+ Time: %initialTime $
+ Initial Gold: %Initialgold $ Initial skill: #skill $ $
return

sub saveData
set %gold #gold + %goldCorrection
set %goldGain #gold - %initialRoundGold + %goldCorrection
set %totalGoldGain %totalGoldGain + %goldGain
set %time #scnt - %initialRoundTime
set %totalTime %totalTime + %time
set %timeMinutes %time / 60
set %totalTimeMinutes %totalTime / 60
set %skill #skill - %initialSkill

execute SaveTextToFile.Vbs #false #false %path fishingData.txt
+ Time: #time $ Time fishing: %time s %timeMinutes min $
+ Total time fishing: %totalTime s %totalTimeMinutes min
+ $ Gold: %gold $ Gold Gain: %goldGain $
+ Total Gold Gain: %totalGoldGain $
+ Skill: #skill $ Skill Gain: %skill $ $
return
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 sub
« Reply #22 on: May 10, 2009, 01:52:05 AM »
0
So that you know you haven't been wasting your time on this, I have changed shard (this time RunUO) and now the Script 4x4 Fishing I made it seems to work like charm. After I test it a little longer I will post it in the forum.
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 sub
« Reply #23 on: May 10, 2009, 10:07:39 PM »
0
Good to hear!  At least you got something going that's we useful.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: