[Deu/Eng] Code GPT and Beem for Terracore

in #deutsch10 months ago (edited)

image.png

Um mir einen Eindruck von Terracore für die HiQ zu bekommen, habe ich vor ein paar Wochen auch mit Terracore angefangen. Ich habe immer nur so nebenbei bei Terracore reingeguckt. Dabei habe ich mir aber einiges an SCRAP entgehen lassen, da ich ständig ausgeraubt wurde.

Natürlich habe ich von einigen Leuten mitbekommen, dass sie Autoclaim Skripte haben. Als ich dann erneut von jemanden hörte, dass er das auch macht, dachte ich mir dann endlich: "Ok, das brauch ich auch."

Ein Blick in die Doku verrät, dass es sogar einen Public API Endpoint gibt. Dieser ermöglicht Upgraden, Claimen und Angreifen. Für Claimen sieht das Ganze so aus:

To get an idea of Terracore for the HiQ, I also started playing Terracore a few weeks ago. I've only ever looked at Terracore in passing. But I missed out lot of SCRAP because I was constantly being robbed.

Of course, I heard from some people that they have autoclaim scripts. When I heard again from someone that he was doing it too, I finally thought to myself: "Ok, I need that too".

A look at the doc reveals that there is even a Public API Endpoint. This enables upgrading, claiming and attacking. For claiming, the whole thing looks like this:


async function claim(player, amount) {
    var hash = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);

    const json = {
        "amount": amount,
        "tx-hash": hash
    };

    //convert json to string
    const data = JSON.stringify(json);

    hive.broadcast.customJson(process.env.ACTIVE_KEY, [player.username], [], 'terracore_claim', data, function(err, result) {

    });
}

Mein nächster Gedanke war, dass ich das ja in Python mit Beem nachbauen könnte. Was ein bissle merkwürdig an der Claim Funktion aus der Doku erscheint, sind die Keys "amount" und "tx-hash" der customJson. Mir war nicht ganz klar woher ich weiß wie viel ich claimen kann und warum ich irgendwas hashen sollte.

My next thought was that I could recreate this in Python with Beem. What seems a bit strange about the claim function from the doc are the keys "amount" and "tx-hash" of the customJson. It was not clear to me how I know how much I can claim and why I should hash anything.


var hash = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);

Allerdings erzeugt diese Zeile offenbar nur einen random "hash". Da ich mir jüngst CodeGPT für Visual Studio Code installiert hatte und dies aber eigentlich nicht nutzte, fragte ich einfach mal ChatGPT via CodeGPT nach einer einfachen Hash Funktion. Und folgendes kam dabei raus:

However, this line apparently only creates a random "hash". Since I had recently installed CodeGPT for Visual Studio Code and didn't actually use it, I simply asked ChatGPT via CodeGPT for a simple hash function. And this is what came out:


def simple_hash(input_str):
    # Convert the input string to bytes
    input_bytes = input_str.encode()
    
    # Use the hash() function to generate a hash value
    hash_value = hash(input_bytes)
    
    return hash_value

Dann habe ich bei Beem noch fix nachgeguckt wie ich eine customJson in die Chain hämmere und fertig...

Naja, ich wusste immernoch nicht was der Key "amount" soll. Aber ich dachte mir ich teste einfach mal:

Then I looked up how to smash a customJson into the chain with Beem and that was it...

Well, I still didn't know what the amount was supposed to do. But I thought I would just test it:


while True:
    time.sleep(60*60*4)

    
    hive = Hive(nobroadcast=False, keys=key)


    input=str(random.randint(1,100))

    

    print(hive.custom_json(id='terracore_claim', required_auths=['quekery'],
            json_data={
            "amount": '0.5', 
            "tx-hash": simple_hash(input)}))

Mein erster Versuch hat auch gleich funktioniert. Offenbar ist der Wert von "amount" egal, da immer alles, was verfügbar ist, geclaimt wird. Auch scheint der "hash" relativ egal zu sein. Das war jetzt ein quick and dirty Claim Skript in Python. Vielleicht mache ich demnächst auch noch ein Battle Skript.

My first attempt also worked straight away. Apparently the value of "amount" doesn't matter, because everything that is available is always claimed. The "hash" also seems to be relatively unimportant. Maybe I'll do another script for battling soon.

  |     |     |     |     |     |  

Sort:  

Hast und Amount sind in der Tat egal, einfach nur etwas übergeben. Hash ist vermutlich nur dafür, um sicherzustellen, dass es eine neue Transaktion ist.

Ja, ich denke, dass der "Hash" ne Art ID ist. Aber es ist eigentlich kein Hash !LOOL

!PIZZA

Was macht eine Wolke mit Juckreiz?
Sie fliegt zum Wolkenkratzer.

Credit: mugglow
@mein-senf-dazu, ich habe dir im Namen von @quekery einen $LOLZ Token gesendet
Verwende den Befehl !WITZ oder !LOOL, um einen Witz und ein $LOLZ zu teilen.

Are You Ready for some $FUN? Learn about LOLZ's new FUN tribe!
.(1/4)

Was auch super an der Hive Python Bibliothek "Beem" ist, ist die Verwaltung der private Keys in einem eigenen Wallet. Dann muss man die nicht hart codiert in den Code schreiben.

Und nicht vergessen vor dem Claimen jemanden automatisch zu überfallen ;-)

Bin grad am Überlegen, ob man Upgraden der Eigenschaften auch automatisch machen solte. Dann muss man eigentlich gar nichts mehr machen außer den Quests.

Ich weiß aber nicht wie ich die richtigen Leute finde zum überfallen. Ich schätze da hat Terracore noch ne eigene Datenbank.

!PGM
!PIZZA
!LOOL

Hi, sowas könnte ich auch gut gebrauchen. schliesslich werden bei mir knapp 80% an Scraps geklaut was schon sehr ordentlich ist. Da ich kaum Ahnung von Codes oder scripting habe, hilft dir das hier ja weiter:

https://hivegadgets.com/terracoregame.html

Hiermit kann man recht "einfach" immer den besten überfallen, weiss aber nicht ob man darauf zugreifen kann und ein code daraus ableiten lässt

Ansonsten wünsche ich noch viel Erfolg

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS - 0.01 WOO tokens

remaining commands 0

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards!

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


Was macht eine Wolke mit Juckreiz?
Sie fliegt zum Wolkenkratzer.

Credit: mugglow
@prinzvalium, ich habe dir im Namen von @quekery einen $LOLZ Token gesendet
Verwende den Befehl !WITZ oder !LOOL, um einen Witz und ein $LOLZ zu teilen.


PLAY & EARN $DOOM


.(1/4)

Ich lass mir einfach eine Liste aller Spieler ausgeben, sortiere die nach liquiden Scrap und nehme dann den mit den meisten Scrap und mit relativ wenig Dodge.

Und wo bekommst du die Liste her?

I do not play well with others when it comes to competition. I'm not a competitive person and believe things can be done in a different way so if there is a way to play a competitive game without actually having to compete that would be awesome.

Awesome! I haven't been playing Terracore... but have been playing Golem Overlord.

They won't let you automate GO, so I'm stuck pushing buttons over and over and over. !lolz

I may have to check out Terracore. Drop your referal link and I will check it out too. :)

Why are cats bad storytellers?
Because they only have one tale.

Credit: marshmellowman
@quekery, I sent you an $LOLZ on behalf of @captaincryptic

(2/10)
Delegate Hive Tokens to Farm $LOLZ and earn 110% Rewards. Learn more.

https://www.terracoregame.com/?ref=quekery

For GO I only have to claim every 8 h but for Terracore I have to claim every 4 h and you will get robbed more often. So it's hard to do it manually. !LOOL !PGM

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS - 0.01 WOO tokens

remaining commands 0

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards!

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


Was ist grün und riecht nach roter Farbe?
Grüne Farbe.

Credit: smooms
@captaincryptic, ich habe dir im Namen von @quekery einen $LOLZ Token gesendet
Verwende den Befehl !WITZ oder !LOOL, um einen Witz und ein $LOLZ zu teilen.


PLAY & EARN $DOOM


.(1/4)

Ok da hat sich ja doch einiges getan.💪✌
werd sicher bald auf dich zukommen wegen des Skripts.
LG
!LOL
!hiqvote

Schau wir mal wie Terracore in Zukunft noch wird !LOOL

!PIZZA

Was ist grün und schlittert über die Wiese?
Ein Pinguin im Tarnanzug.

Credit: thatgermandude
@bechibenner, ich habe dir im Namen von @quekery einen $LOLZ Token gesendet
Verwende den Befehl !WITZ oder !LOOL, um einen Witz und ein $LOLZ zu teilen.


PLAY & EARN $DOOM


.(2/4)

Genau einfach mal abwarten, läuft ja vor sich hin.😉😂
LG
!HUG
!LOL

Dear @quekery, you just got hugged.
I sent 1.0 HUG on behalf of @bechibenner.
(2/3)

What do you call it when a chickpea kills someone?
Hummus-cide

Credit: reddit
@quekery, I sent you an $LOLZ on behalf of @bechibenner

(5/10)
ENTER @WIN.HIVE'S DAILY DRAW AND WIN HIVE!

Why should you never play poker in the jungle?
Too many cheetahs.

Credit: marshmellowman
@quekery, I sent you an $LOLZ on behalf of @bechibenner

(4/10)

PLAY & EARN $DOOM

PIZZA!

$PIZZA slices delivered:
quekery tipped mein-senf-dazu
quekery tipped prinzvalium
@quekery(2/15) tipped @bechibenner

You Crack Us Up!

This Post Was Manually Curated by the FUN Curation Team.
Help reward #fun content creators by joining our curation trail on Hive.Vote.
Or Delegate Hive to @lolz.curate and earn LOLZ farming rewards.

Click to delegate 10, 25, 50, 100, or 1000 HP with HiveSigner.

@bechibenner, the HiQ Smart Bot has recognized your request (1/3) and will start the voting trail.

In addition, @quekery gets !PIZZA from @hiq.redaktion.

For further questions, check out https://hiq-hive.com or join our Discord. And don't forget to vote HiQs fucking Witness! 😻

Congratulations @quekery! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You got more than 3000 replies.
Your next target is to reach 3250 replies.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Hive Power Up Day - July 1st 2023
Announcing the Travel Reimbursement Fund for HiveFest⁸