91
Scripting Chat / set #lpc What does it do?
« on: July 01, 2013, 09:15:26 PM »
What does this command do? I see it used a lot and I see it usually as set #lpc 100 and a few times as set #lpc 200.
Thanks!!
Thanks!!
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.
;================================================
SUB GET_LOOT
GOSUB CHECK_WEIGHT
FINDITEM %LOOT C_ , %CORPSE_CONTAINER
IF #FINDCNT > 0
{
FOR #FINDINDEX 1 #FINDCNT
{
EXEVENT DRAG #FINDID #FINDSTACK
WAIT 20
EXEVENT DROPC #BACKPACKID
WAIT 20
}
}
FINDITEM JJG C_ , #Backpackid
IF #FINDCNT > 0
{
FOR #FINDINDEX 1 #FINDCNT
{
Event Property #Findid
If Spined In #Property && %Bos_Option #False
{
EXEVENT DRAG #FINDID #FINDSTACK
WAIT 20
EXEVENT DROPC %Corpse_Container
WAIT 20
}
}
}
IF #CHARPOSX <> %STARTX
{
REPEAT
EVENT PATHFIND %STARTX %STARTY %STARTZ
WAIT 40
UNTIL #CHARPOSX = %STARTX %STARTY %STARTZ
}
WAIT 1
HIDEITEM %NEW_CORPSE
WAIT 1
RETURN
;================================================
SUB CUT_LOOT
finditem %LOOT C_ , #backpackid
for #findindex 1 #findcnt
{
set #lobjectid %SCISSORS
event macro 17
target
set #ltargetid #findid
set #ltargetkind 1
event macro 22
wait 8
}
RETURN
;===================================================================
;===================================================================
; Script Name: Crisis Inscription Trainer (Will become Crisis INscription Master after future updates.)
; Author: Crisis
; Version: 2.1
; Client Tested with: 7.0.31.0
; EUO version tested with: 1.5 (version 242)
; Shard OSI / FS: OSI
; Release Date: 06/27/2013
; Revision Date: N/A
; Purpose:
; .Train Inscription 0-100
;
; Revisions:
; . N/A
;
; Requirements:
; . You need to have a resouce bag and a storage bag secured in your house or in a bank box.
; . You must have all regs, blank scrolls, and iron ingots in your resource secure bag.
; . You must have a completed scrolls bag secured in your house or in a bank box.
; . You must have at least one tinker tool in your backpack.
; . You must have enough tinkering to craft tinker tool kits and scribe pens.
; . If you are using your bank box, you must must be at the bank say "bank" before starting the script.
; . Choose EA or RUNUO hard coded at the beginning of the script.
;
; Future Updates:
; . Craft individual scrolls in quantity (Magery, Necromancy, Mysticism)
; . Craft Spellbooks and Runebooks
; . Fill Spellbooks
;
; Special Thanks:
; . Ximan for helping me immensly with setting this up and testing it.
; . You taught me so much!
;
; Copyright: 2013 Crisis
;===================================================================
;===================================================================
;Setup
set %fishingpole XHF_KDF
set %bones BJK_EJK_DJK_YIK_XIK_AJK_ZJK_KJK_FJK_ZIK
set %scissors KAG_JAG
gosub Menu
;===================================================================
sub Menu
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_Button 44 12 95 33 Start Fishing
menu Show 421 270
if #menubutton <> N/A
gosub menubuttons
or
if #menubutton = pause
gosub pause
return
;===================================================================
sub menubuttons
menu HideEUO
set #menubutton N/A
repeat
until #menubutton <> N/A
menu delete start
menu Font Color WindowText
menu Font Size 10
menu Font BGColor Red
menu Button pause 44 12 95 33 Pause ; creates new button
set #menubutton N/A
menu delete start
gosub Fishing
repeat
until #menubutton = start
if #menubutton = start
;===================================================================
sub pause
set #menubutton N/A
repeat
until #menubutton <> N/A
menu delete pause
menu Font Color WindowText
menu Font Size 10
menu Font BGColor Green
menu Button Start 44 12 95 33 Start ; creates new button
set #menubutton N/A
menu delete pause
gosub menubuttons
repeat
until #menubutton = pause
if #menubutton = pause
;=========================================
Start:
Gosub Setup
;===================Sub Setup============================
Sub Setup
set %TinkerTools JTL_GTL_KTL
Set %Tongs OBG
Set %Boards TLK
Set %MortarPestle RQF
Set %EmptyPitcher WYF
Set %FullPitcher VBM
Set %Potash AFZ
Set %SaveList NWH_RCG_FCG_FKF
Set %DumpList
set %Ingots ENK
set %cwin 530_497 ; Crafting window size
set %gumpwait 1 ; Increase number to slow down clicks on menus. 20 = 1 second.
set %targetcursorwait 1 ; Increase number as above
Display Ok Select the container with your resources in it.
set #targcurs 1
while #targcurs = 1
wait 1
set %ResourceSecure #ltargetID
set #lobjectID #ltargetID
set #nextcposx 400
set #nextcposy 0
event macro 17
wait 20
{
gosub mainmenu
}
return
;===================Sub Main Menu======================
sub MainMenu
menu Clear
menu Window Title Crisis High Seas Munitions Factory
menu Window Color $FFFFFFFF
menu Window Size 190 130
menu Font Transparent #true
menu Font Align Right
menu Font Name Comic Sans MS
menu Font Size 8
menu Font Style b
menu Font Color Lime
menu Font Transparent #false
menu Font Align Left
menu Font BGColor $FFFFFFFF
menu Text EUOLabel1 63 0 Select One:
menu Font Name MS Sans Serif
menu Font Style
menu Font Color WindowText
menu Font BGColor Window
menu Font BGColor Lime
menu Button begin 64 62 55 25 Start
menu Font Name Comic Sans MS
menu Font Style b
menu Font Color Lime
menu Font BGColor $FFFFFFFF
menu Font Name MS Sans Serif
menu Font Style
menu Font Color WindowText
menu Font BGColor Window
menu Combo Create list 20 16 150
menu Combo Add list Potash
menu Combo Add list Black Powder
menu Combo Add list Light Powder Charge
menu Combo Add list Heavy Powder Charge
menu Combo Add list Light Grapeshot
menu Combo Add list Light Cannonball
menu Combo Add list Heavy Grapeshot
menu Combo Add list Heavy Cannonball
menu Combo Add list Fuse Cord
menu Combo Add list Match Cord
menu Combo Add list Match
menu Combo Add list Swab
menu Combo Add list Ramrod
menu Show 421 270
set #menubutton N/A
repeat
until #menubutton <> N/A
menu delete begin
menu hide
menu get list
if #menures = 1
set %craftable Potash
if #menures = 2
set %craftable BlkPwdr
if #menures = 3
set %craftable LtPwdrChg
if #menures = 4
set %craftable HvyPwdrChg
if #menures = 5
set %craftable LtGrpSht
if #menures = 6
set %craftable LtCanBall
if #menures = 7
set %craftable HvyGrpSht
if #menures = 8
set %craftable HvyCanBall
;choosesitem %craftable
if %craftable = Potash
{
Display You must be next to a water trough and have a water pitcher in your backpack.
gosub MakePotash
}
if %craftable = BlkPwdr
{
gosub MakeBlackPowder
}
if %craftable = LtPwdrChg
{
gosub LightPowderCharge
}
if %craftable = HvyPwdrChg
{
gosub HeavyPowderCharge
}
if %craftable = LtGrpSht
{
gosub LightGrapeShot
}
if %craftable = LtCanBall
{
gosub LightCannonBall
}
if %craftable = HvyGrpSht
{
gosub HeavyGrapeShot
}
if %craftable = HvyCanBall
{
gosub HeavyCannonBall
}
until #charghost = yes
return
;===================Sub Make Potash===========================
Sub MakePotash
MakePotashLoop:
finditem %Boards C_ , #backpackid
if #findstack < 10
{
set %quantityinpack 100 - #findstack
Gosub Move_Resource_To_Container %Boards 0 %ResourceSecure #BackpackID %quantityinpack
If ! #Result
{
display You need to place more boards in your Resource Secure and hit play.
pause
GoTo MakePotashLoop
}
}
{
finditem %EmptyPitcher C_ , #backpackid
gosub ENs_FillPitchersFromWaterTrough
}
{
finditem %MortarPestle C_ , #backpackid
set #lobjectid #findid
If #findcnt < 2
gosub MakeMortarPestle
}
event macro 17
gosub waitforgump %cwin
if ! #result
{
Display Dbl Click a mortar and pestle in your backpack and hit play
Pause
}
gosub OffsetClick 25 190
gosub waitforgump %cwin
if ! #result
{
GoTo MakePotashLoop
}
Gosub OffSetClick 230 210 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakePotashLoop
}
Gosub OffSetClick 281 452 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakePotashLoop
}
gosub CheckPotash
return
;================Sub Move Resource==========================
Sub CheckPotash
finditem %Potash C_ , #backpackid
if #findstack >= 500
{
set %quantityinpack 500 - #findstack
gosub Move_Resource_To_Container %Potash 1102 #BackpackID %ResourceSecure %quantityinpack
}
goto MakePotashLoop
return
;================Sub Move Resource==========================
Sub Move_Resource_To_Container
; Sub moves a stackable resource from one container to another
; Checks Item Color to insure proper identification (Required)
; Will return #False if there are not enough of the resource
; #True with a successful move
;----------------------------------------------------------
; SAMPLE CALL Line
; Gosub Move_Resource_To_Container ItemType ItemColor ContainerIDSource ContainerIDDestination AmountToMve
;----------------------------------------------------------
namespace push
namespace local NCS
Set !ResourceItemType %1
Set !ResourceColor %2
Set !ResourceSource %3
Set !ResourceDestination %4
Set !ResourceCountToMove %5
Set !ResourceCountToMoveCheck %5
Finditem !ResourceItemType C_ , !ResourceSource
Set #findindex 0
Set #FindCol N/A
Set !ResourceLocated No
while #findindex < #findcnt && No in !ResourceLocated
{
set #findindex #findindex + 1
If #FindCol = !ResourceColor && #FindStack < !ResourceCountToMove && #FindCnt > #findindex
{
exevent drag #FindID #FindStack
Wait 15
exevent dropc !ResourceDestination
Wait 15
Set !ResourceCountToMove !ResourceCountToMove - #FindStack
Set #findindex 0
Finditem !ResourceItemType C_ , !ResourceSource
}
If #FindCol = !ResourceColor && #FindStack >= !ResourceCountToMove
{
exevent drag #FindID !ResourceCountToMove
Wait 15
exevent dropc !ResourceDestination
Wait 15
Set !ResourceLocated Yes
}
}
If #FindIndex = 0 || No in !ResourceLocated
{
IgnoreItem Reset
Namespace pop
Return #False
}
Finditem !ResourceItemType C_ , !ResourceDestination
Set #findindex 0
Set #FindCol N/A
Set !ResourceLocated No
while #findindex < #findcnt && No in !ResourceLocated
{
set #findindex #findindex + 1
If #FindCol = !ResourceColor && #FindStack >= !ResourceCountToMoveCheck
{
Namespace pop
IgnoreItem Reset
Return #True
}
}
Namespace pop
Return #False
;=================sub ENs_FillPitchers======================
sub ENs_FillPitchersFromWaterTrough ; %1= troughrange , defaults to 12 if nothing passed
If %waterTroughTypes = N/A
set %waterTroughTypes TEE_WEE_QEE_VEE
IF %emptypitcherTypes = N/A
set %emptypitcher WYF
If %0 <> 1
set %waterTroughRange 12
finditem %waterTroughTypes G_ , %waterTroughRange
If #Findcnt = 0
event exmsg #charid 3 0 ERROR No Water Trough Found
IF #findcnt > 0
{
set %WaterTroughId #findid
finditem %emptypitcher C_ , #backpackid
if #findcnt > 0
{
For #findindex 1 #findcnt
{
set #lobjectid #findid
event exmsg #charid 3 0 Empty pitchers found, filling! #findindex of #findcnt
event macro 17
target 5s
set #Ltargetkind 1
set #ltargetid %WaterTroughID
event macro 22
wait 20
}
}
}
return
;==================Sub Wait for Gump=========================
sub waitforgump
set %timeout #scnt + 10
while #contsize <> %1
{
wait 1
if #scnt > %timeout
{
return #false
}
}
wait %gumpwait
return #true
;==================Sub Wait for Target Cursor================
sub WaitForTargetCursor
set %timeout #scnt + 4
Repeat
wait %targetcursorwait
if #scnt > %timeout
return #false
Until #TARGCURS = 1
return #true
;=================Sub Offset Click===========================
sub OffsetClick
set %tempx %1 + #CONTPOSX
set %tempy %2 + #CONTPOSY
click %tempx %tempy f
return
;=========================================
Start:
Gosub Setup
;=========================================
;--------- EasyUO Menu Designer Code Begin ---------
sub MainMenu
menu Clear
menu Window Title Crisis High Seas Munitions Factory
menu Window Color $FFFFFFFF
menu Window Size 190 130
menu Font Transparent #true
menu Font Align Right
menu Font Name Comic Sans MS
menu Font Size 8
menu Font Style b
menu Font Color Lime
menu Font Transparent #false
menu Font Align Left
menu Font BGColor $FFFFFFFF
menu Text EUOLabel1 63 0 Select One:
menu Font Name MS Sans Serif
menu Font Style
menu Font Color WindowText
menu Font BGColor Window
menu Font BGColor Lime
menu Button begin 64 62 55 25 Start
menu Font Name Comic Sans MS
menu Font Style b
menu Font Color Lime
menu Font BGColor $FFFFFFFF
menu Font Name MS Sans Serif
menu Font Style
menu Font Color WindowText
menu Font BGColor Window
menu Combo Create list 20 16 150
menu Combo Add list Potash
menu Combo Add list Black Powder
menu Combo Add list Light Powder Charge
menu Combo Add list Heavy Powder Charge
menu Combo Add list Light Grapeshot
menu Combo Add list Light Cannonball
menu Combo Add list Heavy Grapeshot
menu Combo Add list Heavy Cannonball
menu Combo Add list Fuse Cord
menu Combo Add list Match Cord
menu Combo Add list Match
menu Combo Add list Swab
menu Combo Add list Ramrod
menu Show 421 270
set #menubutton N/A
repeat
until #menubutton <> N/A
menu delete begin
menu hide
menu get list
if #menures = 1
set %item Potash
if #menures = 2
set %item BlkPwdr
if #menures = 3
set %item LtPwdrChg
if #menures = 4
set %item HvyPwdrChg
if #menures = 5
set %item LtGrpSht
if #menures = 6
set %item LtCanBall
if #menures = 7
set %item HvyGrpSht
if #menures = 8
set %item HvyCanBall
choosesitem %item
return
if %item = Potash
{
gosub MakePotash
}
if %Item = BlkPwdr
{
gosub MakeBlackPowder
}
if %item = LtPwdrChg
{
gosub LightPowderCharge
}
if %item = HvyPwdrChg
{
gosub HeavyPowderCharge
}
if %Item = LtGrpSht
{
gosub LightGrapeShot
}
if %Item = LtCanBall
{
gosub LightCannonBall
}
if %Item = HvyGrpSht
{
gosub HeavyGrapeShot
}
if %Item = HvyCanBall
{
gosub HeavyCannonBall
}
until #charghost = yes
while #charGhost = YES
wait 0
return
;===================Sub Setup============================
Sub Setup
set %TinkerTools JTL_GTL_KTL
Set %Tongs OBG
Set %Boards TLK
Set %MortarPestle RQF
Set %EmptyPitcher WYF
Set %FullPitcher VBM
Set %SaveList NWH_RCG_FCG_FKF
Set %DumpList
set %Ingots ENK
set %cwin 530_497 ; Crafting window size
set %gumpwait 1 ; Increase number to slow down clicks on menus. 20 = 1 second.
set %targetcursorwait 1 ; Increase number as above
Display Ok Select the container with your resources in it.
set #targcurs 1
while #targcurs = 1
wait 1
set %ResourceSecure #ltargetID
set #lobjectID #ltargetID
set #nextcposx 400
set #nextcposy 0
event macro 17
wait 20
{
gosub mainmenu
}
return
;===================Sub Make Potash===========================
Sub MakePotash
Display You must be next to a water trough and have a water pitcher in your backpack.
MakePotashLoop:
finditem %Boards C_ , #backpackid
if #findstack < 10
{
set %quantityinpack 100 - #findstack
Gosub Move_Resource_To_Container %Boards 0 %ResourceSecure #BackpackID %quantityinpack
If ! #Result
{
display You need to place more boards in your Resource Secure and hit play.
pause
GoTo MakePotashLoop
}
}
finditem %EmptyPitcher C_ , #backpackid
{
gosub ENs_FillPitchersFromWaterTrough
}
finditem %MortarPestle C_ , #backpackid
set #lobjectid #findid
If #findcnt < 2
gosub MakeMortarPestle
event macro 17
gosub waitforgump %cwin
if ! #result
{
Display Dbl Click a mortar and pestle in your backpack and hit play
Pause
}
gosub OffsetClick 25 190
gosub waitforgump %cwin
if ! #result
{
GoTo MakePotashLoop
}
Gosub OffSetClick 230 210 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakePotashLoop
}
Gosub OffSetClick 281 452 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakePotashLoop
}
return
;========================Sub Make TinkerKit==================
Sub MakeTinkerKit
MakeKitLoop:
finditem %Ingots C_ , #backpackid
if #findstack < 10
{
set %quantityinpack 10 - #findstack
Gosub Move_Resource_To_Container %Ingots 0 %ResourceSecure #BackpackID %quantityinpack
If ! #Result
{
display You need to place more ingots in your Resource Secure and hit play.
pause
GoTo MakeKitLoop
}
}
finditem %TinkerTools C_ , #backpackid
set #lobjectid #findid
event macro 17
gosub waitforgump %cwin
if ! #result
{
Display Dbl Click a tinker kit in your backpack and hit play
Pause
}
Gosub OffSetClick 30 130
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Gosub OffSetClick 230 130 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Gosub OffSetClick 230 130 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Return
;======================Sub Make MortarPestle======================
Sub MakeMortarPestle
MakeMortarPestleLoop:
finditem %Ingots C_ , #backpackid
if #findstack < 10
{
set %quantityinpack 10 - #findstack
Gosub Move_Resource_To_Container %Ingots 0 %ResourceSecure #BackpackID %quantityinpack
If ! #Result
{
display You need to place more ingots in your Resource Secure and hit play.
pause
GoTo MakeMortarPestleLoop
}
}
finditem %TinkerTools C_ , #backpackid
set #lobjectid #findid
If #findcnt < 2
gosub MakeTinkerKit
event macro 17
gosub waitforgump %cwin
if ! #result
{
Display Dbl Click a tinker tool in your backpack and hit play
Pause
}
gosub OffsetClick 27 129
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Gosub OffSetClick 232 89 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Gosub OffSetClick 281 451 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Gosub OffSetClick 281 451 f
gosub waitforgump %cwin
if ! #result
{
GoTo MakeKitLoop
}
Return
;================== Wait for gump ======================
sub waitforgump
set %timeout #scnt + 10
while #contsize <> %1
{
wait 1
if #scnt > %timeout
{
return #false
}
}
wait %gumpwait
return #true
;================== Wait for Target Cursor ================
sub WaitForTargetCursor
set %timeout #scnt + 4
Repeat
wait %targetcursorwait
if #scnt > %timeout
return #false
Until #TARGCURS = 1
return #true
;==========================================================
Sub Move_Resource_To_Container
; Sub moves a stackable resource from one container to another
; Checks Item Color to insure proper identification (Required)
; Will return #False if there are not enough of the resource
; #True with a successful move
;----------------------------------------------------------
; SAMPLE CALL Line
; Gosub Move_Resource_To_Container ItemType ItemColor ContainerIDSource ContainerIDDestination AmountToMve
;----------------------------------------------------------
namespace push
namespace local NCS
Set !ResourceItemType %1
Set !ResourceColor %2
Set !ResourceSource %3
Set !ResourceDestination %4
Set !ResourceCountToMove %5
Set !ResourceCountToMoveCheck %5
Finditem !ResourceItemType C_ , !ResourceSource
Set #findindex 0
Set #FindCol N/A
Set !ResourceLocated No
while #findindex < #findcnt && No in !ResourceLocated
{
set #findindex #findindex + 1
If #FindCol = !ResourceColor && #FindStack < !ResourceCountToMove && #FindCnt > #findindex
{
exevent drag #FindID #FindStack
Wait 15
exevent dropc !ResourceDestination
Wait 15
Set !ResourceCountToMove !ResourceCountToMove - #FindStack
Set #findindex 0
Finditem !ResourceItemType C_ , !ResourceSource
}
If #FindCol = !ResourceColor && #FindStack >= !ResourceCountToMove
{
exevent drag #FindID !ResourceCountToMove
Wait 15
exevent dropc !ResourceDestination
Wait 15
Set !ResourceLocated Yes
}
}
If #FindIndex = 0 || No in !ResourceLocated
{
IgnoreItem Reset
Namespace pop
Return #False
}
Finditem !ResourceItemType C_ , !ResourceDestination
Set #findindex 0
Set #FindCol N/A
Set !ResourceLocated No
while #findindex < #findcnt && No in !ResourceLocated
{
set #findindex #findindex + 1
If #FindCol = !ResourceColor && #FindStack >= !ResourceCountToMoveCheck
{
Namespace pop
IgnoreItem Reset
Return #True
}
}
Namespace pop
Return #False
;============================================
sub OffsetClick
set %tempx %1 + #CONTPOSX
set %tempy %2 + #CONTPOSY
click %tempx %tempy f
return
;============================================
sub ENs_FillPitchersFromWaterTrough ; %1= troughrange , defaults to 12 if nothing passed
If %waterTroughTypes = N/A
set %waterTroughTypes TEE_WEE_QEE_VEE
IF %emptypitcherTypes = N/A
set %emptypitcher WYF
If %0 <> 1
set %waterTroughRange 12
finditem %waterTroughTypes G_ , %waterTroughRange
If #Findcnt = 0
event exmsg #charid 3 0 ERROR No Water Trough Found
IF #findcnt > 0
{
set %WaterTroughId #findid
finditem %emptypitcher C_ , #backpackid
if #findcnt > 0
{
For #findindex 1 #findcnt
{
set #lobjectid #findid
event exmsg #charid 3 0 Empty pitchers found, filling! #findindex of #findcnt
event macro 17
target 5s
set #Ltargetkind 1
set #ltargetid %WaterTroughID
event macro 22
wait 20
}
}
}
return
finditem %Potash C_ , #backpackid
If #findcnt > 100
{
set %quantityinresourcesecure 100 - #findstack
Gosub Move_Resource_To_Secure %Potash 0 #BackpackID %ResourceSecure %quantityinpack
}
;======================================================================
sub InitTinkerGump ; Makes sure you have two kits and sets it to use iron
finditem %Tinkertools C_ , #backpackid
if #findcnt < 1
{
display Get a tinker tool in your backpack and restart the script.
halt
}
if #findcnt < 2
{
gosub MakeTinkerKit
}
TinkerSetLoop:
finditem %Tinkertools C_ , #backpackid
set #lobjectid #findid
event macro 17
gosub waitforgump %cwin
if ! #result
{
Goto TinkerSetLoop
}
Gosub OffSetClick 30 370
gosub waitforgump %cwin
if ! #result
{
Goto TinkerSetLoop
}
Gosub OffSetClick 230 70
gosub waitforgump %cwin
if ! #result
{
Goto TinkerSetLoop
}
Gosub OffSetClick 30 450
wait 5
Return
Gosub OffSetClick 30 450