Jump to content
Eternal Lands Official Forums
Sign in to follow this  
WizzKidd

RedKnight v2.0 (KillBot Source Code)

Recommended Posts

I need help getting a bot to go to Votd. near the gold mine for testing. i dont know how to find the ITEM name to use. such as a banner on a boat to travel. i see how they did the IP and underworld but ive tried to get it to go to Desert pines and votd. but i cant seem to find the right "item" number for the banners.

Share this post


Link to post
Share on other sites

Hmm how so? as if i was going to find the "desert pines boat flag" how can itell the Id number. and i cant figure out how the Pk_list works. it set my alt as a member that he should be attacked on sight etc. but the bot sits there and doesnt do anything. and any clue how to command him to retreive a bag?

Share this post


Link to post
Share on other sites

helpte5.jpg

 

in the map editor just go to the item in question and click on it, then you get this window that pops up with it's information. for the redknight program it's the object ID you want to know

 

as for the bag command. there is no command to tell him to "get bag" once the bot reaches his home he should retieve any bag in his sight automatically, if not something is wrong.

Edited by Tuver

Share this post


Link to post
Share on other sites

#beam me (and various other # commands)

 

some commands don't work as expected (they give an error), just stick 0x20 on the end and it will work fine.

Thanks, LabRat. Now, I can get a few more commands working on Trismegitus (ALCH guild bot).

The only question is, how do you deal with the multiple part messages like the #exp and #sto?

Share this post


Link to post
Share on other sites

For commands that you don't send a parameter for (eg #arm), put a trailing space on the end.

 

For commands that do have a parameter (eg #beam me, #sto ore) just send the command as is.

Share this post


Link to post
Share on other sites

For commands that you don't send a parameter for (eg #arm), put a trailing space on the end.

 

For commands that do have a parameter (eg #beam me, #sto ore) just send the command as is.

I tried with and without the 0x20. I have not looked at an asci chart for ages, but that is a space, right?

"#list_guild alch" does require the 0x20 to be added to the end.

I have tried other commands with the 0x20 added to the end. It seems that it is ok to add an 0x20 to the end of any #command. Have you found out of any commands that can't have one at the end?

Edited by nathanstenzel

Share this post


Link to post
Share on other sites

A space isn't required, it's just the server that's being stupid, it doesn't understand the \0.

If you don't send the \0, you don't need the space either.

(IIRC)

Share this post


Link to post
Share on other sites

anyone know how to change the message where this bot says "only IRON and her allies are allowed"?

its coming from the redknight.exe file

Yes, you have to edit the source and re-compile. The sentence is hard-coded (not configurable). There are a couple such messages where it talks about the guild IRON or talks about a cave (not all guild maps are caves). Those all have to be changed in the source.

Share this post


Link to post
Share on other sites
send_raw_text("Sorry, only %s and her allies are permitted to pass.  If you take one step or do not leave within %d seconds you will be PKed!",my_guild,(attack_delay/1000));  //Greeting, name, greeting message

One press of Ctrl-F9, .exe placed gracefully on one of my sites and the problem is solved.

Share this post


Link to post
Share on other sites

i dealt with that code now for a couple of hours and still fixing stuff.

 

the problem with the cast are that there is code to check if enough essences are in the inventory, but the code wont work when the bot does not have any of the required essences.

 

for(i = 0; i < 36; i++) {

..if(!strncmp(inv.name, "Health Essence", 14)) {

....// this line would never be reached if there are no health essences at all, because the compare wont found something if it is not here

....if(inv.quantity < 40)

......send_raw_text("#gm %cI am running low on health ess. Please bring some soon!", 127+c_red1);

....else if (inv.quantity < 20)

......send_raw_text("#gm %cI am almost out of health ess. Please bring some quick!", 127+c_red2);

....else if (inv.quantity == 0)

......send_raw_text("#gm %cI am OUT of health ess and can not restore! Please bring some NOW!!", 127+c_red3);

..}

}

that is the problem with all those constructs they will not notice when the required item is not in inv at all, will provide improvements/diffs for that

 

 

the construct should look like

fit=0; // preset founditem to 0

for(i = 0; i < 36; i++) {

..if(!strncmp(inv.name, "Health Essence", 14)) {

....fit=inv.quantity; // set the found item variable with the quantity in inv

..}

}

 

// changed also the order of check, in the old version only "<40" was true for all cases, cause it was checked first

if (fit == 0)

..send_raw_text("#gm %cI am OUT of health ess and can not restore! Please bring some NOW!!", 127+c_red3);

else if (fit < 20)

..send_raw_text("#gm %cI am almost out of health ess. Please bring some quick!", 127+c_red2);

else if(fit < 40)

..send_raw_text("#gm %cI am running low on health ess. Please bring some soon!", 127+c_red1);

 

 

will also add the found code changes to my copy

 

will eventually turn all those code in a generic function, cause it is used very often

Edited by Greypal

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×