0

I am playing an online game which have the following code for its button. Reason I want to add the window with buttons are because I have to browse several menus before the page (with the button I want to click) appear/been loaded. So instead of having to browse the menu through a number of clicks before I can actually click on that button, I'm planning on making a window with a dummy button which will do the same code below.

<form accept-charset="utf-8" method="post" action="http://www.marketglory.com/account/fight/view_user/498">

    <input type="hidden" value="startFight" name="action"></input>
    <input type="hidden" value="trainer" name="username"></input>
    <input class="nd_submit_big mt13" type="submit" value="Atack now" name="test"></input>
</form>

The game is located at http://goo.gl/YyvS5o

On the action link above, the userID which is 498 is a constant.

I don't know where to begin. This is my starting script:

// ==UserScript==
// @name        MarketGold In a New Look
// @namespace   http://userscripts.org/scripts/edit_src/180590
// @description This script is intended to enhance the playing experience with the strategy game at http://www.marketglory.com
// @author      Wind™
// @include     http://*.marketglory.com/*
// @exclude     http://*.marketglory.com/forum/*
// @exclude     http://forum.marketglory.com/*
// @grant       GM_addStyle
// @version     1.0.1
// ==/UserScript==

/* Still no idea how to start this */

To summarize it all:

  1. Create a drag-able window (like an iframe or something) ~ about 200x80 size.
  2. Create a dummy button which will do the code I mentioned above.
  • Start [here](http://stackoverflow.com/q/6480082/331508). When you get that working, Search Stack Overflow or ask for how to make the window draggable. – Brock Adams Oct 24 '13 at 18:00

1 Answers1

0
//...
//@require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
//@require http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js
//...

$('<table/>').wrapInner($('input[value="Atack now"]').parent()).draggable().css({'padding':'20px', 'background':'black', 'opacity':'0.5'}).appendTo('body');

Demo

zanetu
  • 3,740
  • 1
  • 21
  • 17