Author Topic: Help with Menu setup  (Read 3606 times)

0 Members and 1 Guest are viewing this topic.

Offline The GhostTopic starter

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Help with Menu setup
« on: July 04, 2013, 09:20:07 PM »
0
I have this on menu to help me clean my backpack after Fishing and  hunting.   My question is there a way to get the menu to return to false after the pack is clean.   I'm trying to clean up a few of my snippet and learning menu at the same time.   


menu check packcheck 10 90 130 15 #false Clean Backpack

Quote
sub updatemenu
        menu get packcheck
        if #menures = #true
        {
           gosub packcheck
        }
return

Thx

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: Help with Menu setup
« Reply #1 on: July 04, 2013, 09:31:23 PM »
0
Something like this?

Code: [Select]
sub updatemenu
        menu get packcheck
        if #menures = #true
        {
           gosub packcheck
           menu set packcheck #FALSE
        }
return
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The GhostTopic starter

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Help with Menu setup
« Reply #2 on: July 04, 2013, 10:30:51 PM »
0
So simple, it work fine.  thx  I was trying with the button but no joy.  BTW  what are #2 for.  I  have seen 2 and 4 on other ppl build.

Quote
if #menubutton = packcheck 2
    set #menubutton N/A
      gosub findshoes  ; feed them to goat
      gosub cutfish    ; cut into steak
      gosub eatfish    ; eat special fish


Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Help with Menu setup
« Reply #3 on: July 04, 2013, 10:43:05 PM »
0
if you put a # after an IF statement it tells the Script how many lines to execute if the If statement is true.


if #true = #True 3
do this
do this
do this

Same thing as

if #True = #True
{
do this
do this
do this
}


This function is rather.... obsolete though... Makes debugging very annoying... Parenthesis are much better. In My Opinion anyways.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

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: Help with Menu setup
« Reply #4 on: July 04, 2013, 11:09:06 PM »
0
Bad bad manwinc for teaching that horrible technique.....  YUCK!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Help with Menu setup
« Reply #5 on: July 04, 2013, 11:43:58 PM »
0
I didn't teach it!!!!  I stared at the code he posted for like 10 minutes going wtf???

It took me years to break myself of Goto's, now I'm trying to break myself of Multiple Returns out of subs, Indenting, Etc etc etc.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Bookwyrm

  • Elite
  • *
  • *
  • Posts: 357
  • Activity:
    0%
  • Reputation Power: 5
  • Bookwyrm has no influence.
  • Gender: Male
  • Better Civilization Through Medication
  • Respect: +34
  • Referrals: 0
    • View Profile
Re: Help with Menu setup
« Reply #6 on: July 05, 2013, 02:08:25 AM »
0
Bad bad manwinc for teaching that horrible technique.....  YUCK!

*Hands TM the Wet Noodle of Death*
Been nice knowin' ya MW :'(
"The most preposterous notion that H. Sapiens has ever dreamed up is that the Lord God of Creation, Shaper and Ruler of all the Universes, wants the saccharine adoration of His creatures, can be swayed by their prayers, and becomes petulant if He does not receive this flattery. Yet this absurd fantasy, without a shred of evidence to bolster it, pays all the expenses of the oldest, largest, and least productive industry in all of history."   Lazarus Long

"The second most preposterous notion is that copulation is inherently sinful."   L.L. 

Offline The GhostTopic starter

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Help with Menu setup
« Reply #7 on: July 05, 2013, 07:08:44 AM »
0
I didn't teach it!!!!  I stared at the code he posted for like 10 minutes going wtf???

It took me years to break myself of Goto's, now I'm trying to break myself of Multiple Returns out of subs, Indenting, Etc etc etc.

That how I feel most of the time.   You guy are my mentors in here.  So since I use some old MW work he wrote, I must have the same bad habit. :)

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Help with Menu setup
« Reply #8 on: July 05, 2013, 10:34:24 AM »
0
I've never used the

if This = That 2
Do this
Do this

Code Structure
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: Help with Menu setup
« Reply #9 on: July 05, 2013, 12:41:48 PM »
0
Heh.....   I was vaguely aware that you could throw the # on the end of the IF but I've also never used it.   I do the one line execution without parenthesis all the time though, & I cannot make up my mind if that's good practice or not...  Actually anytime I use parenthesis I always type the pair of them and THEN go put stuff between them just so I never forget.


1)

If %Good_day #True
  Msg Hooray

2)

If %Good_day #True
  {
     Msg Hooray
  }

Offline The GhostTopic starter

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Help with Menu setup
« Reply #10 on: July 05, 2013, 03:26:42 PM »
0
Trying to make send of all those command. and all those little detail can only be find by asking question and paying close attention how the line cycle.

MW, not said that you do,  I look around and try to figure out how to write properly.
« Last Edit: July 05, 2013, 04:08:58 PM by The Ghost »

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Help with Menu setup
« Reply #11 on: July 05, 2013, 04:43:51 PM »
0
Yeah,

Here are a few Tips.

Take advantage of Subs other People have already written. EndlessNight has a very Comprehensive sub library you can abuse to no end. This will save you a whole lot of time Rebuilding the Wheel. Crafting Subs, Clicking subs, Rail Engines, Recalling, Pixel Scanning, Journal Scanning its all been done by multiple coders here and you can incorporate them into your scripts very Easily. If you are Having a hard time coding something, just ask for help or ask if someone has already coded a specific Piece.

Avoid Goto's at all Cost.

Once you start getting the Hang of EUO's language, introduce yourself to Namespaces. It Basically gives you the ability to code Subs without Having to worry about OverWriting a variable somewhere in the Script. Namespaces are Essential for Universal Subs. You can Also use them To Communicate Between Scripts (My Favorite kind of thing)

I really need to Clean up my Sub Library and Get Some Finished/Polished Products over here available for people to use. Its really quite silly how easy most of this stuff is once you have the Bulk of the Code done.

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: