2731
New member introductions / Re: Hi My Name is Drago
« on: June 18, 2013, 04:50:37 AM »
Welcome!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
;===================================================================
; Script Name: Crisis SOS Chest Fisher
;
; Author: Crisis
; Version: 2.0a
; Shard OSI / FS: OSI
; Release Date: 05/07/2012
; Revision Date: 06/15/2013
; Purpose:
; Completely automates the operation of fishing up treasure chests when you are in the correct area of your SOS.
; Works great with Kal In Ex's SOS Master
;
; Features:
; . Automatically fishes until you fish up a treasure chest. Cuts bones after fishing up chest.
;
; Revisions:
; . Added bone cutting sub
; . Cleaned up code
;
; Requirements:
; . You should be on a boat in the area of your SOS
; . Must have the SOS in your backpack
;
; Special Thanks:
; TrailMyx for helping me iron out the kinks and for TrailMyx's Advanced Journal Handler
; _C2_ for the Menu Tutorial http://www.scriptuo.com/index.php?topic=1535.0
; Endless Night for helping me fix the issues with the Menu
;===================================================================
;Setup
set %fishingpole XHF_KDF
set %bones BJK_EJK_DJK_YIK_XIK_AJK_ZJK_KJK_FJK_ZIK
set %scissors KAG_JAG
gosub DrawMenu
set %ENDScript NO
set %StartFishing NO
return
;===================================================================
sub CheckMenu
if #menubutton = Pause
gosub PausePressed
if #menubutton = Start
gosub StartPressed
if #menubutton = Closed
set %ENdScript YES
return
;===================================================================
sub DrawMenu
menu Clear
menu Window Title Crisis SOS Fisher 2.0
menu Window Color Black
menu Window Size 186 57
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 10
menu Font Style
menu Font Color WindowText
menu Font BGColor Lime
menu Button Start 44 12 95 33 Start Fishing
menu Show 421 270
set #menubutton N/A
return
;===================================================================
sub Pausepressed
menu delete Pause
menu Font Color WindowText
menu Font Style
menu Font Color WindowText
menu Font BGColor Lime
menu Button Start 44 12 95 33 Start Fishing
set #menubutton N/A
return
;===================================================================
sub startpressed
menu delete Start
menu Font Color WindowText
menu Font Size 10
menu Font BGColor Green
menu Button Pause 44 12 95 33 Pause ; creates new button
gosub TM_AdvJournalSync FISHING
set #menubutton N/A
return
;===================================================================
sub TM_AdvJournalSync FISHING
finditem %fishingpole _C #CHARID
if #FINDKIND = -1
{
finditem %fishingpole _C #BackpackID
if #FINDKIND = -1
display ok How can you fish without your fishing pole?
halt
if #FINDKIND = 1
SOSFishLoop
}
SOSFishLoop:
findItem %fishingpole 1
set #LObjectID #FindID
set #LTargetKind 2
set #LTargetX 0 + #CharPosX
set #LTargetY 4 + #CharPosY
event macro 17 0
target
event macro 22 0
set %fishtimeout #SCNT + 9
target 11s
gosub TM_AdvJournalScan FISHING VALID_ADVANCE chest_from_the_depths_of_the_ocean
if #RESULT = #TRUE
{
display ARRR!! Thar be me sunken booty!!
goto EndSOSFishLoop
}
goto SOSFishLoop
{
EndSOSFishLoop:
gosub CutBones
}
return
;===================================================================
sub CutBones
finditem %scissors C_ , #backpackid
if #findcnt > 0
{
set #lobjectid #findid
finditem %bones C_ , #backpackid
while #findcnt > 0
{
event macro 17
target
set #ltargetid #findid
set #ltargetkind 1
event macro 22
wait 8
finditem %bones C_ , #backpackid
if finditem = 0
halt
}
}
return
;===================================================================
sub WaitForTargetCursor
set %timeout #scnt + 4
Repeat
wait %targetcursorwait
if #scnt > %timeout
return #false
Until #TARGCURS = 1
return #true
;===================================================================
sub TM_AdvJournalGetTrigger
namespace push
namespace local TM_AdvJS_ , %1
set #RESULT !trigger
namespace pop
set !TM_FunctionCalled #TRUE
return #RESULT
;===================================================================
; %1 - Journal Name
; %2 - #LPC setting (optional)
; Brings !_jindex up to the most recent #journal entry
sub TM_AdvJournalSync
namespace push
namespace local TM_AdvJS_ , %1
set !_jindex #jindex + 1
if %0 > 1
set !lpc_set %2
namespace pop
set !TM_FunctionCalled #TRUE
return
;===================================================================
; %1 - Journal Name
; %2 - NONE, ADVANCE , ( _VALID ) - advances jindex pointer, anything else
; %3, %4, %5, etc strings to match
; returns #TRUE for match, #FALSE for no match
; Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
; Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
; About %2 arguments:
; NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing)
; ADVANCE: no spam checking, advances #jindex copy
; VALID: invokes SPAM filtering, no advance of #jindex copy
; VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copy
sub TM_AdvJournalScan
namespace push
namespace local TM_AdvJS_ , %1
set !args %2
set !temp_lpc #LPC
if !lpc_set = N/A
set #LPC 1000
else
set #LPC !lpc_set
set !num_args %0
set !first_arg 3
set !sampled_jindex #JINDEX
if !_jindex = N/A
set !_jindex !sampled_jindex
if !charname = N/A
{
set !charname #CHARNAME
AdvJournalScan_loop1:
str pos !charname #SPC
if #STRRES <> 0
{
set !val #STRRES - 1
str left !charname !val
set !left #STRRES
set !val !val + 1
str del !charname 1 !val
set !charname !left , _ , #STRRES
goto AdvJournalScan_loop1
}
}
set !index !first_arg
repeat
set !temp_jindex !_jindex
set !text % . !index
while !temp_jindex <= !sampled_jindex
{
scanjournal !temp_jindex
str pos #JOURNAL !charname 1
set !namepos #STRRES
str count #JOURNAL !charname
set !namecnt #STRRES
str pos #JOURNAL :_ 1
set !smcpos #STRRES
str pos #JOURNAL !text 1
set !textpos #STRRES
if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
set !pass #TRUE
else
set !pass #FALSE
if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
{
set !temp_jindex !temp_jindex + 1
if ADVANCE in !args
set !_jindex !temp_jindex
set !trigger !text
set #LPC !temp_lpc
namespace pop
set !TM_FunctionCalled #TRUE
return #TRUE
}
set !temp_jindex !temp_jindex + 1
}
set !index !index + 1
until !index - !first_arg > !num_args - !first_arg
set %10 !sampled_jindex - !_jindex
set %10 %1 , _ , %10 ; for debugging purposes
set #LPC !temp_lpc
set TM_AdvJournalGetTrigger #FALSE
namespace pop
set !TM_FunctionCalled #TRUE
return #FALSE
One of the reasons I set the script up the way I did was to get people to read it before they press play. You should know what you're running before you click the little green arrow
The script is as simple as it gets, you don't need to edit anything.
6. come back 4 hours latter (30 to GM is 4 hours about)
Please forgive the misleading comments above.
If you don't read and edit one small thing in the script, it is literally impossible to do it in 4 hours. Either Rup forgot that he changed the script, or he's never actually used it.
As bodfather said above.. When you see what you are missing, you are definitely going to laugh.
yeah worked perfect gm'd in about... 2 days though... its not as fast lol
2 days? you didn't read the script... there was something you were supposed to change
set %useSOA #true
Here is an example of how I edited it to work for me.
I can't get the gold or pearls to stack in the bank box, though. Do they need a backpack ID and have to go inside a backpack to work, rather than just plop them in the bank box itself?Code: [Select]gosub GumpWait NULL container_gump container_gump
gosub TransferItems NULL HTD -1 #BACKPACKID RFOHQMD %container_MIBs
wait 20
gosub TransferItems NULL WWS -1 #BACKPACKID %container_Stack ; pearls
wait 20
gosub TransferItems NULL POF -1 #BACKPACKID %container_Stack ; gold
wait 20
gosub TransferItems NULL UDF -1 #BACKPACKID TFOHQMD ; nets
wait 20
gosub TransferItems NULL XVH -1 #BACKPACKID QFOHQMD ; maps
wait 20
gosub TransferItems NULL STO_JJG -1 #BACKPACKID UFOHQMD %container_Stack ; Leather, Scales
wait 20
gosub TransferItems NULL ZYZ_SMZ_RMZ_UYZ -1 #BACKPACKID ZNZORND ; Fish Bag 1
wait 20
gosub TransferItems NULL OMZ_NMZ -1 #BACKPACKID MUUFQMD ; Fish Bag 2
wait 20
gosub TransferItems NULL ZYZ_SMZ_RMZ_UYZ_OMZ_ZJF_TYZ_WYZ -1 #BACKPACKID GOZORND ; Fish Bag 3
wait 20
We've got some good threads that explain the joys of virtualization ("V" machines). Here's a link to that section:
http://www.scriptuo.com/index.php?topic=549.0