Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $${
- // Macro by Roflicide, made for slayermarth101
- // The type of button you're pressing (either wooden_button or stone_button)
- &button = "wooden_button";
- // Change this (if necessary) to the name of your timer file
- &timer = "Timer.txt";
- // Prompt variables
- &question = "Do you wish to continue?";
- &yes = "Yes! I want to continue!";
- &no = "No! Back to safety!";
- // Macro variables
- &enabled = "&6&l[MACRO] &r&aEnabled.";
- &disabled = "&6&l[MACRO] &r&aDisabled.";
- &declined = "&6&l[MACRO] &r&aAction declined.";
- &accepted = "&6&l[MACRO] &r&aAction accepted. You have 5 seconds to press it.";
- &timedout = "&6&l[MACRO] &r&aAction timed out.";
- &nextscript = "&6&l[MACRO] &r&aStarting part 2. Button can be pressed again in 5s.";
- IF(flag);
- UNSET(flag);
- LOG(%&disabled%);
- STOP;
- ELSE;
- SET(flag);
- LOG(%&enabled%);
- DO;
- // @timesup is set true when 5s has gone by
- UNSET(@timesup);
- // timeroff is set true when user presses the button twice
- UNSET(timeroff);
- // #hits ensures the button isn't overflowed with multiple requests
- UNSET(#hits);
- // If you're looking at the button and click right-mouse
- IF((%HITID% = %&button%) && (RMOUSE));
- PROMPT(&capture,"$$[[%&yes%,%&no%]]",%&question%,true);
- // Case where user says yes
- IFMATCHES(%&capture%,"%&yes%");
- LOG(%&accepted%);
- // Start the timer in a separate task
- EXEC(%&timer%);
- DO;
- IF((%HITID% = %&button%) && (RMOUSE) && (#hits < 1));
- INC(#hits,1);
- LOG(%&nextscript%);
- SET(timeroff);
- // EXEC(YourScript.txt) / Your code here
- ENDIF;
- WHILE(!@timesup);
- IF(!timeroff && @timesup);
- LOG(%&timedout%);
- ENDIF;
- // Case where user says no or bad input
- ELSE;
- LOG(%&declined%);
- ENDIF;
- ENDIF;
- LOOP;
- ENDIF;
- }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement