TWLan Forum

Full Version: Berninabot v1.0 (+Problem)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey Leute

Vor ungefähr 2 Woche hätte mein Bot schon rauskommen sollen, aber jetzt steht fest, dass er unter Windows im Moment nicht laufen kann, weil in der PHP-Library die "cURL"-Funktion fehlt. Und damit läuft mein gesamter Bot.

Source
Der unverschlüsselte Code meines Bots, vielleicht könnt ihr damit ja etwas anfangen.
Download
[Image: bild.php?id=8]

Mac
Download
[Image: bild.php?id=5]

Linux
Achtung: Da ich keinen Zugang zu einem Linux-System habe, kann ich diese Version nicht testen!
Bitte sagt mir, wenn der Bot nicht läuft oder Fehler ausgibt.
Download (Alpha Version!)
[Image: bild.php?id=6]

Windows
Anleitung zur cURL-Installation
Ansonsten funktioniert der Bot unter Windows nicht!
Download für Windows
[Image: bild.php?id=7]


So, das ist alles was ich habe.
Ich hatte gehofft, dass ich den Bot unter Windows zum laufen bringen würde, aber die PHP-Library ist zu mager.
Tut mir leid.

LG
Molt
wenn ich nachher zeit hab, werd ich mir die linuxversion mal ansehen Wink

schön, dass du das ganze nun doch open source stellst Tongue
Anmerkung: Die Links sind grad down, weil Funpic wieder down ist. -.-

EDIT: Geht wieder.
As an alternative to curl, you can use fsockopen for raw HTTP scripting (see http://php.net/fsockopen)
Add @echo off to your batch file, it'll hide the commands as they're executed Wink
1) And fsockopen is supported by the PHP Version that is installed on the Windows Version?
2) Ok, I'll do.

LG
Molt
1) Can you read manual pages? "fsockopen (PHP 4, PHP 5)" (yes, it is supported in all PHP versions)
Look, here is also written that it's supported by PHP 4 and 5! And it's not included in the TWLan-PHP -.-

LG
Molt
(12.12.2010, 16:59)Molt Wrote: [ -> ]Look, here is also written that it's supported by PHP 4 and 5! And it's not included in the TWLan-PHP -.-

LG
Molt

Well, TWLan does not use it, so why would we add unnecessary code?

Do the following to add curl to TWLan:
1) Download the attachment php_curl.dll and place it in the directory TWLanDirectory/php/ext/
2) Go to TWLanDirectory/apache/bin/ and open the php.ini with an editor (NotePad, etc)
3) Find the line ";extension=php_curl.dll" and remove the ";" in front, so that it becomes "extension=php_curl.dll". Save and close the php.ini.

4) If TWLan is running, run "apache_stop.bat" and then immediately after "apache_start.bat"

The cURL-extension should be activated now. If there are version problems with the library, undo step 3 and repeat step 4 and contact me in this thread, so that we can find a curl-library that works.

(12.12.2010, 16:59)Molt Wrote: [ -> ]Look, here is also written that it's supported by PHP 4 and 5! And it's not included in the TWLan-PHP -.-

LG
Molt
You should get in habit reading the PHP Manual. fsockopen is included by default without any configuration necessary: http://nl2.php.net/manual/en/network.installation.php
cURL isn't: http://www.php.net/manual/en/curl.installation.php

(12.12.2010, 21:54)Chrissi Wrote: [ -> ]
(12.12.2010, 16:59)Molt Wrote: [ -> ]Look, here is also written that it's supported by PHP 4 and 5! And it's not included in the TWLan-PHP -.-

LG
Molt

Well, TWLan does not use it, so why would we add unnecessary code?

Do the following to add curl to TWLan:
1) Download the attachment php_curl.dll and place it in the directory TWLanDirectory/php/ext/
2) Go to TWLanDirectory/apache/bin/ and open the php.ini with an editor (NotePad, etc)
3) Find the line ";extension=php_curl.dll" and remove the ";" in front, so that it becomes "extension=php_curl.dll". Save and close the php.ini.

4) If TWLan is running, run "apache_stop.bat" and then immediately after "apache_start.bat"

The cURL-extension should be activated now. If there are version problems with the library, undo step 3 and repeat step 4 and contact me in this thread, so that we can find a curl-library that works.
I've an optimized PHP build laying here. It has GD compiled in (for the map). I'll upload it some day Smile
Schade das der für Windof nicht geht...

Ich persöhnlich vermisse einen guten Bot für Ds lan, weil kein guter so richtig bei mir funktionieren will. Und die Bots die angreifen und ausbauen, sind am Anfang mal ganz nett, im weitern Spielverlauf aber einfach nur noch leichte Ziele.

Was kann der Bott denn so alles?
- Aufbauen (baut auch dann ganz aus, wenn man mit erhöhten Gebäuden spielt)
- Farmen
- Adeln

Ich werde, sobald als möglich, nach Chrissis Anleitung cURL auf meiner Windows-Version testen, und dann einen Installer in die get.php integrieren, wenn's funktioniert.

LG
Molt
Sobald es auf Windows funktioniert werd ich ihn mal teste Big Grin
Freue mich auf den.... Der hört sich vielversprechend an Smile
Molt, please take a look at fsockopen. It's not hard to implement. Your cURL function calls are basically doing a GET or POST request, with a cookie and a POST body and fetching the result.
Please check my earlier post.
Hoffe der läuft gut, denn ich vermisse einen guten Bot bei 1.4 ^^
@Lekensteyn: Sounds not bad, I'll take a look at it and maybe I will rewrite my bot.

@powerzocker: Der Bot greift produziert manchmal Deff in Offdörfern, aber wenn auf ein Dorf von dir so 300 Angriffe reinkommen, spielt das nicht mehr soo eine Rolle Wink

Trotzdem, wenn irgendjemand herausfindet, warum mein Bot manchmal in Offdörfern Deff baut, sagt es mir bitte, ich habe nämlich 2 Tage nach dem Fehler gesucht und nix gefunden -.-

LG
Molt
Wie siehts aus, gibt es nun eine Lösung welche Funktioniert um diesen Bot auf Windows zu spielen?
Bis jetzt nicht, und die Entwicklung ist bis auf weiteres eingestellt, zumal in der nächsten Version ein neuer Bot kommt.
Nimm einfach fsockopen und bau dir damit dein Request zusammen.

Das hier reicht z.B. für ein einfaches GET-Request:
Code:
GET $URL HTTP/1.1\r\n
Hostname: localhost\r\n
\r\n
Ich weiss schon, aber es lohnt sich nicht, den Bot weiter zu entwickeln, blner baut einen in die DSLan ein, der weit besser ist als meiner. Und es gibt noch andere Dinge zu tun Wink

LG
Molt
(12.12.2010, 21:54)Chrissi Wrote: [ -> ]
(12.12.2010, 16:59)Molt Wrote: [ -> ]Look, here is also written that it's supported by PHP 4 and 5! And it's not included in the TWLan-PHP -.-

LG
Molt

Well, TWLan does not use it, so why would we add unnecessary code?

Do the following to add curl to TWLan:
1) Download the attachment php_curl.dll and place it in the directory TWLanDirectory/php/ext/
2) Go to TWLanDirectory/apache/bin/ and open the php.ini with an editor (NotePad, etc)
3) Find the line ";extension=php_curl.dll" and remove the ";" in front, so that it becomes "extension=php_curl.dll". Save and close the php.ini.

4) If TWLan is running, run "apache_stop.bat" and then immediately after "apache_start.bat"

The cURL-extension should be activated now. If there are version problems with the library, undo step 3 and repeat step 4 and contact me in this thread, so that we can find a curl-library that works.

Omg hab das jetzt gemacht, und wenn ich die drei .bat wie üblich öffne kommt alle paar Sekunden die Fehlermeldung "Das Programm kann nicht gestartet werden, da php5.dll auf dem Computer fehlt. Installieren Sie das Programm erneut, um das Problem zu beheben."

Da ich keine Ahnung von dem habe, frage ich mal hier ob mir jemand helfen kann. Was soll ich jtzt tun, oder ist die Anleitung doch falsch und der Bot wird nie auf Windows funktionieren.

Fals es hilft, ich habe Windows7 64 Bit Version und benutze die dsLan 1.2 Version. Hat es vlt. etwas mit der dsLan Version zu tun? Sollte ich es nochmal mit der 1.4 versuchen? Ich hab leider, wie gesagt, keine Ahnung xD

Pages: 1 2