Author Topic: Marlboroman Scripts  (Read 18481 times)

0 Members and 1 Guest are viewing this topic.

Offline MarlboromanTopic starter

  • Jr. Member
  • **
  • Posts: 17
  • Activity:
    0%
  • Reputation Power: 1
  • Marlboroman has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Marlboroman Scripts
« on: May 25, 2010, 10:16:56 AM »
+2
Here is a collection of scripts that I have wrote over the years.


my first script was a keg emptier designed to just empty full or partial kegs to bottles.  

I wrote a Script for making Wood Pulp when the new expansion came out kind of useful if you want to make your own scrolls or binders.

A Focus/Meditation/Healing trainer using the cloak of corruption.  Be aware the the cloak of corruption lowers your karma and is a cursed item.

A Chicken Coop Assitant that tends your chicken coops.


A smoke bomb maker. Simply to make smokebombs using alchemy.


Ok I went through with the Syntax checker and cleaned up each of the scripts.




There are 5 attachment(s) in this post. You must register and post an acceptable introduction to download
Keg emptier.suo
Marlboro Mans FHM Trainer 1.2.suo
MarlboroMan's Reluctant Chicken Coop Attendant.suo
SmokeBomb.suo
Wood Pulp.suo
« Last Edit: May 25, 2010, 01:03:18 PM by Marlboroman »

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Marlboroman Scripts
« Reply #1 on: May 25, 2010, 10:21:15 AM »
+2
Wow, nice stuff... thanks!
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Marlboroman Scripts
« Reply #2 on: May 25, 2010, 10:30:28 AM »
+2
Hey MM, if you get a chance you might want to run your scripts through the SUO syntax checker.  That might help you out a bit.  It still helps me, and I wrote it!  ;)

Thanks for the goodies, though!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline MarlboromanTopic starter

  • Jr. Member
  • **
  • Posts: 17
  • Activity:
    0%
  • Reputation Power: 1
  • Marlboroman has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Re: Marlboroman Scripts
« Reply #3 on: May 25, 2010, 10:42:38 AM »
+2
Sure thing I'll check that out.. I wrote all these scripts using Easy Uo hopefully there wont be any problems with the menu's and so forth.  I don't imagine a problem but I will check that out.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Marlboroman Scripts
« Reply #4 on: May 25, 2010, 10:48:24 AM »
+2
Ya, I originally wrote ALL my scripts with EasyUO.  Then after I wrote ScriptUO, I was kinda disgusted by all the typos and other strange things that I just learned to live with as the scripts executed.  There's still a few things about the syntax checker that are a bit off, but for the most part it will catch 95% of syntax strangeness.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline MarlboromanTopic starter

  • Jr. Member
  • **
  • Posts: 17
  • Activity:
    0%
  • Reputation Power: 1
  • Marlboroman has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Re: Marlboroman Scripts
« Reply #5 on: May 25, 2010, 12:18:26 PM »
+2
Ok Clean up is complete however the Syntax checker said a few of my subs had no return all though when I scrolled down to the exact line of the sub as it said there was a return in the sub. So I'm not sure if it didn't find it or if it just skipped the return but the Return was there in every sub. I believe out of the 5 scripts only 3 had this occurance don't know what to think of it other then odd. However it made me go back and double check things alot.  Thought I was going crazy no return in a sub scroll down find the return then think what the hell is it talking about.  Needless to say half a pack of cigarettes later the return was there all along and I don't know what it's talking about. 

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Marlboroman Scripts
« Reply #6 on: May 25, 2010, 12:32:23 PM »
+2
You have subs embedded within other subs...

The keg emptier script...

Line 131 is "sub menutracker"
Lines 132-176 have no "return"
Line 177 is "sub securesetup"

So the flow would be from one sub directly into another which is incorrect. You probably should have a sub to complete your "menutracker".

*I only looked at this one script, it's probably something similar with the other 2 you found.

******************************

Wood Pulp

Line 301 is "sub startcookin" which doesn't have a return. There's a goto loop in there ( :'( ) and it *should* have a return someplace.

******************************

Chicken Coop

Line 627 has your halt sub "sub Endchicktending"

SUO doesn't see the return (you have the script halting) and that's why it generated the error. It's semantics really, just put a return after the "halt" and SUO will be happy. Of course the return will never be hit.

******************************************

Smoke Bomb

** Error - Line 85: Unknown command Hide
** Error - Line 576: Unknown command to
** Error - Line 579: Unknown command mortars

Actually line 578 should be in there too, looks like free text and line 578 starts with the word "if" which is a valid EUO command :)

*******************************************

Just pointing out that SUO is a great tool to clean up code.

« Last Edit: May 25, 2010, 12:43:54 PM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Marlboroman Scripts
« Reply #7 on: May 25, 2010, 12:34:08 PM »
+2
ScriptUO is literally looking for subroutines to have matching sub/returns, even though you might be halting the sub before you ever get to a return.  Take for example your chicken coup script:

Code: [Select]

sub Endchicktending

gosub putuppet
display out of food restock and restart script please!

halt


This will give the error because there's no matching "return".  Sure, it doesn't need it, but unfortunately the syntax checker can't interpret your intentions within a script, and only reports explicit syntax deviations. 

Make sense?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Marlboroman Scripts
« Reply #8 on: May 25, 2010, 12:38:49 PM »
+2
You have subs embedded within other subs...

The keg emptier script...

Line 131 is "sub menutracker"
Lines 132-176 have no "return"
Line 177 is "sub securesetup"

So the flow would be from one sub directly into another which is incorrect. You probably should have a sub to complete your "menutracker".

*I only looked at this one script, it's probably something similar with the other 2 you found.

There are people at EUO that claim it's OK to have nested subroutines.  I never really programmed that way since I always felt that subroutines should be singular.  So if you do have nested subroutines, it'll always throw that error.  Thing is, many people code not intending to have nested routines, but they do.

Sorry, not trying to nitpick your stuff since there's lots of ways to code these things.  And the syntax checker isn't always 100% right, especially if you are really intending to code away from what it expects.  Just use it as a tool, and not a rule.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline onlyindreams

  • Spaz Ferret's Personal Assistant
  • Insane Scripter
  • *
  • Posts: 1305
  • Activity:
    0%
  • Reputation Power: 13
  • onlyindreams barely matters.onlyindreams barely matters.
  • Respect: +182
  • Referrals: 2
    • View Profile
Re: Marlboroman Scripts
« Reply #9 on: May 25, 2010, 12:46:07 PM »
+2
Thanks for sharing!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +861
  • Referrals: 11
    • View Profile
Re: Marlboroman Scripts
« Reply #10 on: May 25, 2010, 12:46:23 PM »
+2
So how does the script flow with nested subs?

1 - sub this
2 - stuff
3 - sub that
4 - different stuff
5 - return

Does the flow just go 1-5? Then you *could* gosub to either 1 or 3 from elsewhere in the script?

*Actually you would have to either gosub to 1 AND 3, or 3 by itself.

Seems like poor scripting if you ask me.

If you want to do subs 1 and 3 consecutively, then just call them like that from the main loop, or wherever your calling those subs from... but don't run them together.....
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline MarlboromanTopic starter

  • Jr. Member
  • **
  • Posts: 17
  • Activity:
    0%
  • Reputation Power: 1
  • Marlboroman has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Re: Marlboroman Scripts
« Reply #11 on: May 25, 2010, 12:51:51 PM »
+2
I found the things it is talking about on my chicken tending script found the error and why it is saying it's embedded.

the sub directly above it is as follows
Code: [Select]
sub Endchicktending

gosub putuppet
display out of food restock and restart script please!

halt

;===============================================

because of how the sub is entended to work that particular script is not entended to have a return because it stops the script when you are out of food. there for it says the next script is embeded with this one however it is not entended because of the script does hit the Endchicktending sub it stops the script and does not continue.  I guess I could through a return under the halt just to make it cosher with the syntax error check just to make it happy I suppose it will.  As a result of finding this occurance I went back and checked the other 2 and I did find simular things so I fixed those as well.

Offline MarlboromanTopic starter

  • Jr. Member
  • **
  • Posts: 17
  • Activity:
    0%
  • Reputation Power: 1
  • Marlboroman has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Re: Marlboroman Scripts
« Reply #12 on: May 25, 2010, 01:09:55 PM »
+2
The Subs aren't run together I've finished checking the syntax and no errors reporting now however I don't consider it an error when the scripts halts then there is a different sub under that.  I don't consider that embedding. and for the purposes of the script and how it runs neither does the program because the script HALTS and doesn't move forward.  However I did put a return under the halt even though it will never hit the return. As much it is all fixed  and lovely now so the Syntax Error check doesn't have a problem with it.  As you said TM it is a good tool but just that a tool and it does have parameters that it can not go around. such as a sub that stops the script. All in all good tool. However it doesn't beat good old ole know how.  I've never put a return after a halt before in my life all though now I will probably do so to avoid a checker from saying I have something wrong.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • 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: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Marlboroman Scripts
« Reply #13 on: May 25, 2010, 01:13:18 PM »
+2
Yup, I can only teach it so much.  So I taught it how to walk.  It's up to the scripter to run.  And if you can run with scissors, then you get an extra gold star!  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline MarlboromanTopic starter

  • Jr. Member
  • **
  • Posts: 17
  • Activity:
    0%
  • Reputation Power: 1
  • Marlboroman has no influence.
  • Gender: Male
  • Respect: +13
  • Referrals: 1
    • View Profile
Re: Marlboroman Scripts
« Reply #14 on: May 25, 2010, 01:29:00 PM »
+2
Well I don't know about scissors sounds kind of dangerous but I can definitly do bubble gum that should be worth something.  Either way I have updated the downloads and all are fixed with the syntax check.. when you get a chance just give them a double check.  Thanks.

Tags: