Author Topic: Menu Button not working right  (Read 3551 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
Menu Button not working right
« on: January 15, 2015, 09:54:41 PM »
0
I have make a quick menu, so I can disco target and kill target.    Right now if I disco target and try to kill it after,( hit the wips bottom the script select disco button.   If I hit the kill first if work but the second time I hit wips it will try to disco.     Can't figure out what I did work on the menu side of the house.  Can anyone shed some light plx.

The Event macro was to help me see when it exit the loop

Code: [Select]

set %monsterkill XI_EG_TG_ZF ;
set %discomonster XI_EG_TG_ZF
gosub menu1

set #menuButton N/A
Repeat
  If #MenuButton <> N/A
     {
     gosub #menuButton
     set #menuButton N/A
     }
until #false

Sub button1
menu Font Style b
menu Font Color Black
Menu Font Bgcolor White
menu font size 8
menu button button1 0 0 80 30 In.Used Disco
gosub disco
gosub reset
return

Sub button2 ;  Attach Wips
menu Font Style b
Menu Font Bgcolor White
menu Font Color red
menu font size 8
menu button button2 0 30 80 30 In.Used Wips
 repeat
finditem %monsterkill G_10
if #findkind = -1
{
  goSub button2menu
  return
}
if #findcnt > 0
{
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 17   ; 36  mb
  target 3s
  event macro 22
  wait 2s
}
; until #CLICNT = 0
until #false

Sub button2menu
  menu Font Style b
  Menu Font Bgcolor black
  menu Font Color red
  menu font size 12
  menu button button1 0 30 80 30 Wips
  return


;  =====================Disco Component ==================================
; ========================================================================
sub disco
finditem %discomonster G_10
if #findkind = -1
   return
set %targeted #findid
set #ltargetid %targeted
set #ltargetkind 1
event macro 13 15 ; disco
target
event macro 22
wait 30
gosub TM_AdvJournalScan disco NONE play_jarring already_in_discord
if #result = #true
   {
   gosub TM_AdvJournalSync disco
   Event macro 3 0 Disco
   return
   }
if #result = #false
   {
   gosub TM_AdvJournalSync disco
   wait 6s
   Event macro 3 0 Fail
   return
   }
Event macro 3 0 exit. last
return

sub reset
menu Font Style b
menu Font Color Yellow
Menu Font Bgcolor green
menu font size 12
menu button button1 0 0 80 30 Disco
return

;=================================================================
; ========================  Menu ========================================
sub menu1
menu clear
wait 15
menu show 160 37
wait 10
menu show 0 770
menu window size 404 60
menu Font Style b
menu Font Color Yellow
Menu Font Bgcolor green
menu font size 12
menu button button1 0 0 80 30 Disco 
;
menu Font Style b
Menu Font Bgcolor black
menu Font Color red
menu font size 12
menu button button2 0 30 80 30 Wips
return
;=================================================================

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: Menu Button not working right
« Reply #1 on: January 15, 2015, 10:27:18 PM »
0
You Overwrite button2 as button1

Sub button2menu
  menu Font Style b
  Menu Font Bgcolor black
  menu Font Color red
  menu font size 12
  menu button button1 0 30 80 30 Wips ; <-
  return

From Your Sub Menu1

menu button button2 0 30 80 30 Wips ; <-

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 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: Menu Button not working right
« Reply #2 on: January 20, 2015, 03:34:01 PM »
0
Thx  I felt ridiculous now. 4 days of work and u fix it  3o sec :(

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: Menu Button not working right
« Reply #3 on: January 20, 2015, 09:08:47 PM »
0
Ohhhhh it took me A LOT MORE Than 30 seconds man.

I must of gone over your code for like 2 hours. Had to Run it a few times to see what you were talking about before I realized what was probably happening.
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 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: Menu Button not working right
« Reply #4 on: January 21, 2015, 08:17:26 AM »
0
I need to be more carefull with copy/paste.  This one bit me in the ass and hard,  Thx for the assist and the time.    Trying to make a Despise helper.     I was looping everthing and find out that while waiting for the new targer i wasn't attacking.  So seen to be faster and just hit button on second account.

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: Menu Button not working right
« Reply #5 on: January 21, 2015, 02:07:05 PM »
0
What Would Suggest Doing for future reference is adding a status Bar to your scripts. In your scripts when you were Making all your Modifications to the Buttons, i'm 99% Sure that you were actually just Constantly Creating New buttons on your Menu Each time that were just stacked on top of each other, which will eventually lead to issues. You'll either need to Delete Them Before Rebuilding them or Change up the Whole Strategy.

Just do a

Menu Edit (Name) (X) (Y) (Length) (Initial Text)

Then, when you want to change what it says you do

Menu Set (Name) "Text"

You will probably have to use , #Spc , To put spaces in between words unless you want to write a Sub to do it for you.

 *Wrote one for you, but you can always write your own.

So, just put

Gosub Mwinc_SPC

And then Type like you normally would after that. And it will turn the sentence into #Result



Code: [Select]
Menu Window Size 250 100
Menu Show 0 0
Menu Edit Status 5 5 240 Status
Gosub Mwinc_SPC This is a Test
Menu Set Status #Result
Wait 40
Gosub Mwinc_SPC This is Not A test
Menu Set Status #Result
Halt

Sub Mwinc_SPC
Namespace Push
Namespace Local Mwinc_SPC
set !String %1
For !N 2 %0
{
set !String !String , #Spc , % . !N
}
set #Result !String
Namespace Pop
Return #Result




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 ZigZagZebra

  • Jr. Member
  • **
  • Posts: 54
  • Activity:
    0%
  • Reputation Power: 1
  • ZigZagZebra has no influence.
  • Gender: Male
  • Respect: +12
  • Referrals: 0
    • View Profile
Re: Menu Button not working right
« Reply #6 on: January 21, 2015, 08:28:00 PM »
0
there goes manwinc, whoring himself out for script help  ;)

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: Menu Button not working right
« Reply #7 on: January 22, 2015, 07:47:20 AM »
0
Thx, More string, Now let see how I can utilize this little snippet.   

Tags: