Sau1707 / ModernBot

A Bot for Grepolis
MIT License
24 stars 20 forks source link

Auto worship god #31

Closed JustAnotherNoobCoder closed 1 year ago

JustAnotherNoobCoder commented 1 year ago

Hi again bro. Do you know what data needs to be used with gpAjax.ajaxPost('frontend_bridge', 'execute', data) to auto worship a god. like model url, action, etc

Sau1707 commented 1 year ago

I'm not sure that do you mean by worship, ma suggestion is to perform the game action and same the network logs, then you analyze the request that was done and from there you can see all the data that is required

JustAnotherNoobCoder commented 1 year ago

I've come up with this, to try and change the god. But no work :(

function changeGod(godId) {
  var data = {
    model_url: 'BuildingTemple',
    action_name: 'change_god',
    arguments: {
      god_id: godId,
      town_id: Game.townId,
    }
  };

  gpAjax.ajaxPost('frontend_bridge', 'execute', data);
}
JustAnotherNoobCoder commented 1 year ago

Nevermind. I'm just gonna use javascript to click the elements on the page. I'm too much of a noob to reverse engineer. thanks

Sau1707 commented 1 year ago

Try this

function change(town_id, new_god) {
        const data = { "god_id": new_god, "town_id": town_id}
        uw.gpAjax.ajaxPost("building_temple", "change_god", data)
 }
JustAnotherNoobCoder commented 1 year ago

Ahhhh. You are the best, thank you so much bro

Sau1707 commented 1 year ago

You're welcome.

Just for information, this are the 8 gods ids: hera, athena, hades, artemis, aphrodite, ares, zeus, poseidon