1
Script Debug / Re: Meatt Wad's First attempt at a full script
« on: October 14, 2011, 03:07:16 PM »
Thanks Cam. I will play around with that and see if I get it.
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: Meatt Wad's Simple Beggar
; Author: Meatt Wad
; Version: 1.0
; Client Tested with: 7.0.18
; EUO version tested with: 1.5.202
; Shard OSI: OSI
; Revision Date: Oct 6, 2011
; Public Release:
; Purpose: Automate Begging
; Globals: none
;====================================
;
;====================================
; Instructions: Find a heavily populated area of NPC's or better yet . . .
; Go Hire Blue NPC's, fighters, beggar's whatever(15 to 20 should do), has to be the ones you pay to follow you.
; Take them to your house and trap them (I like walking them up to third floor and leaving a hole to 2nd
; Allow them to fall through to 2nd floor with no doors and no teles no stairs so they can't escape.)
; I also like to make this room fairly small like 8x8 or less so they are within begging range.
;====================================
; Thanks to everyone at SUO for all the help!
;====================================
; Special thanks to Endless Night for sharing your knowledge with me and helping to edit this script!
;====================================
set %ver 1.0
chooseskill BEGG
set %skill #skill
set %BEGG #skill
set %gain 0
set %gains 0
set %status Begging
menu show 290 112
menu hideEUO
gosub menu
;======== Main Loop ================
REPEAT
gosub find
gosub beg
gosub skillgain
gosub UpdateMenu
until #charghost = yes || #Skill = #Skillcap
halt
;======== Update Menu Sub ===========
sub UpdateMenu
str len %gains
str ins %gains #dot #strRes
menu set EUOLabel4 #strRes
str len #skill
str ins #skill #dot #strRes
menu set EUOLabel6 #strRes
menu set EUOLabel3 %status
if #Charghost = yes
display You are Dead! Script Halted!
return
;============= Find Sub ==========
sub find
repeat
wait 1
finditem HS_IS G_10
if #findcnt = 0
ignoreitem reset
if #findid = #charid
ignoreitem #FINDID
until #FINDcnt >= 1 && #findid <> #charid
RETURN
;============ Beg Sub ===============
sub beg
move #FINDX #FINDY 1 10s
ignoreitem #FINDID
if #FINDDIST > 1
return
Repeat
chooseskill BEGG
set %skill #SKILL
set #LTARGETID #FINDID
set #LTARGETKIND 1
event macro 13 6
target
event macro 22
wait 10s
return
;=============Skillgain sub============
sub skillgain
chooseskill BEGG
if #skill > %BEGG
set %gains %gains + #skill - %BEGG
set %BEGG #skill
if #skill = #skillcap
{
display You have reached your skill cap.$
+$Thanx for using Meatt Wad's Simple Begger
+$
+$Please rate the script at ScriptUO.com
+$
+$
+Script is Halted$
+$
+ ~ Meatt Wad$
}
return
;=========== EasyUO Menu Designer Code ============
sub menu
menu Clear
menu Window Title MeattWads Simple Beggar %ver
menu Window Color Black
menu Window Size 290 112
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 14
menu Font Style
menu Font Color $9933CC
menu Font Transparent #false
menu Font Align Left
menu Font BGColor Black
menu Text EUOLabel1 10 40 Gains:
menu Text EUOLabel2 10 72 Status:
menu Font Size 8
menu Text EUOLabel3 70 80 %status
str len %gains
str ins %gains #dot #strRes
menu Text EUOLabel4 70 48 #strRes
menu Font Size 14
menu Text EUOLabel5 22 10 Skill:
menu Font Size 8
str len #skill
str ins #skill #dot #strRes
menu Text EUOLabel6 70 18 #strRes
return
;====================================================
;==================================
; Script Name: Meatt Wad's Simple Beggar
; Author: Meatt Wad
; Version: 0.2
; Client Tested with: 7.0.18
; EUO version tested with: 1.5.202
; Shard OSI: OSI
; Revision Date: Oct 6, 2011
; Public Release:
; Purpose: Automate Begging
; Globals: none
;====================================
;
;====================================
; Instructions: Find a heavily populated area of NPC's or better yet . . .
; Go Hire Blue NPC's, fighters, beggar's whatever(15 to 20 should do), has to be the ones you pay to follow you.
; Take them to your house and trap them (I like walking them up to third floor and leaving a hole to 2nd
; Allow them to fall through to 2nd floor with no doors and no teles no stairs so they can't escape.)
; I also like to make this room fairly small like 8x8 or less so they are within begging range.
;====================================
; Thanks to everyone at SUO for all the help!
;====================================
; Special thanks to Endless Night for sharing your knowledge with me and helping to edit this script!
;====================================
set %ver 0.2
chooseskill BEGG
set %skill #skill
set %BEGG #skill
set %gain 0
set %gains 0
set %status Begging
menu show 290 112
menu hideEUO
gosub menu
;======== Main Loop ================
REPEAT
gosub find
gosub beg
gosub skillgain
gosub UpdateMenu
until #charghost = yes || #Skill = #Skillcap
halt
;======== Update Menu Sub ===========
sub UpdateMenu
str len %gains
str ins %gains #dot #strRes
menu set EUOLabel4 #strRes
str len #skill
str ins #skill #dot #strRes
menu set EUOLabel6 #strRes
menu set EUOLabel3 %status
if #Charghost = yes
display You are Dead! Script Halted!
return
;============= Find Sub ==========
sub find
repeat
wait 1
finditem HS_IS G_10
if #findcnt = 0
ignoreitem reset
if #findid = #charid
ignoreitem #FINDID
until #FINDcnt >= 1 && #findid <> #charid
RETURN
;============ Beg Sub ===============
sub beg
move #FINDX #FINDY 1 10s
ignoreitem #FINDID
if #FINDDIST > 1
return
Repeat
chooseskill BEGG
set %skill #SKILL
set #LTARGETID #FINDID
set #LTARGETKIND 1
event macro 13 6
target
event macro 22
wait 10s
return
;=============Skillgain sub============
sub skillgain
chooseskill BEGG
if #skill > %BEGG
set %gains %gains + #skill - %BEGG
set %BEGG #skill
if #skill = #skillcap
{
display You have reached your skill cap.$
+$Thanx for using Meatt Wad's Simple Begger
+$
+$Please rate the script at ScriptUO.com
+$
+$
+Script is Halted$
+$
+ ~ Meatt Wad$
}
return
;=========== EasyUO Menu Designer Code ============
sub menu
menu Clear
menu Window Title MeattWads Simple Beggar %ver
menu Window Color Black
menu Window Size 290 112
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 14
menu Font Style
menu Font Color $9933CC
menu Font Transparent #false
menu Font Align Left
menu Font BGColor Black
menu Text EUOLabel1 10 40 Gains:
menu Text EUOLabel2 10 72 Status:
menu Font Size 8
menu Text EUOLabel3 70 80 %status
str len %gains
str ins %gains #dot #strRes
menu Text EUOLabel4 70 48 #strRes
menu Font Size 14
menu Text EUOLabel5 22 10 Skill:
menu Font Size 8
str len #skill
str ins #skill #dot #strRes
menu Text EUOLabel6 70 18 #strRes
return
;====================================================
Any more Ideas on improving this. It is definitely prettier and more organized, runs alot smoother. Thank You Endless this is starting to be fun sub find
repeat
wait 1
finditem HS_IS G_10
if #findcnt = 0
ignoreitem reset ;fixed this
if #findid = #charid
ignoreitem #FINDID
until #FINDcnt >= 1 && #findid <> #charid ;fixed this i think
RETURN
Took me a bit to figure out the ignoreitem reset, and I think the "until" line is good now with a >= ( I understand what is happening here now.)Well Thank You, I just pay attention to how you guys do things and try to mimic in an effort to learn how and why.Thank you for such a quick response. Messing around with your suggestions right now
your welcome ... I've got to tell you, you are doing pretty dam fantastic for your first script.
sub find
repeat
wait 1 ; Give your machine a chance to catch up on tasks
finditem HS_IS G_10
if #findcnt = 0
ignore reset
if #findid = #charid
ignoreitem #FINDID
until #FINDcnt = 1 && #findid <> #charid ; findcnt = number of items found
RETURN ; must must return from a sub
until #FINDcnt = 1 && #findid <> #charid ; findcnt = number of items found
;==================================
; Script Name: Meatt Wad's Simple Beggar
; Author: Meatt Wad
; Version: .1
; Client Tested with: 7.0.18
; EUO version tested with: 1.5.202
; Shard OSI: OSI
; Revision Date: Oct 6, 2011
; Public Release:
; Purpose: Automate Begging
; Globals: none
;====================================
;
;====================================
; Instructions: Find a heavily populated area of NPC's or better yet . . .
; Go Hire Blue NPC's, fighters, beggar's whatever(15 to 20 should do), has to be the ones you pay to follow you.
; Take them to your house and trap them (I like walking them up to third floor and leaving a hole to 2nd
; Allow them to fall through to 2nd floor with no doors and no teles no stairs so they can't escape.)
; I also like to make this room fairly small like 8x8 or less so they are within begging range.
;====================================
; Special thanks to everyone at SUO for all the help!
;====================================
set %ver 0.1
chooseskill BEGGING
set %skill #skill
set %BEGGING #skill
set %gain 0
set %gains 0
set %status Begging
menu show 290 112
menu hideEUO
gosub menu
REPEAT
gosub find
gosub beg
until #charghost = yes
set %status = Dead
gosub menu
display You are Dead! Script Halted!
halt
;============ find sub =============
sub find
finditem HS_IS G_10
if #FINDKIND = -1
{
ignoreitem reset
gosub find
}
if #FINDID = #CHARID
{
ignoreitem #FINDID
gosub find
}
;============beg sub ===============
sub beg
move #FINDX #FINDY 1 10s
finditem #FINDID
if #FINDDIST > 1
{
ignoreitem #FINDID
return
}
chooseskill BEGGING
set %skill #SKILL
set #LTARGETID #FINDID
set #LTARGETKIND 1
event macro 13 6
target
event macro 22
wait 10s
chooseskill BEGGING
if %skill < #SKILL
{
finditem #FINDID
gosub beg
}
ignoreitem #FINDID
gosub skillgain
return
;=============Skillgain sub============
sub skillgain
chooseskill BEGGING
if #skill = #skillcap
{
display You have reached your skill cap.$
+$Thanx for using Meatt Wad's Simple Begger
+$
+$Please rate the script.
+$
+$
+Script is Halted$
+$
+ ~ Meatt Wad$
halt
}
if #skill > %BEGGING
set %gains %gains + #skill - %BEGGING
set %BEGGING #skill
gosub menu
return
;
;--------- EasyUO Menu Designer Code Begin ---------
sub menu
menu Clear
menu Window Title MeattWads Simple Beggar %ver
menu Window Color Black
menu Window Size 290 112
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 14
menu Font Style
menu Font Color $9933CC
menu Font Transparent #false
menu Font Align Left
menu Font BGColor Black
menu Text EUOLabel1 10 40 Gains:
menu Text EUOLabel2 10 72 Status:
menu Font Size 8
menu Text EUOLabel3 70 80 %status
str len %gains
str ins %gains #dot #strRes
menu Text EUOLabel4 70 48 #strRes
menu Font Size 14
menu Text EUOLabel5 22 10 Skill:
menu Font Size 8
str len #skill
str ins #skill #dot #strRes
menu Text EUOLabel6 70 18 #strRes
return
;--------- EasyUO Menu Designer Code End ---------