Posts: 352
Threads: 23
Joined: Jan 2005
Reputation:
0
Seeing as there has been some interrest in my Infinite Anya ShopBot Module, and because I'm bored these days so I need something to, I'm making this thread to refine my javascripting.
If there are anything you wish to change in YAMB, or perhaps some new function you'd like to have added, post here and I'll see what I can do about it. This can be everything from changes in a characters attacking code, to all new scripts and modules.
Most bosses or areas that can be safely run already have a script posted somewhere, either on Blizzhackers or the official YAMB forum, but feel free to post that anyway, and if it already exists, then I can direct you to wherever the script can be found.
Also, if you have any changes you've made to any of your YAMB scripts, for whatever reason, feel free to post them. Someone else might have the same problem as you do.
EDIT: Spelling.
Posts: 352
Threads: 23
Joined: Jan 2005
Reputation:
0
I'll start with my Infinite Anya ShopBot Module. As always, open your configuration file and add the following:
Code: YAMXXP.push("Shopping");
Copy YAM_Shopping.d2l and save it somewhere else as a backup, then open your original YAM_Shopping.d2l and replace it with the following:
Code: // Infinite Anya ShopBot Module - by Cauhtemoc
// This module will make the bot go to Harrogath, visit Anya and shop for the items that you want, go through the red portal
// to Nihlathak's Temple, come back to through the portal, then shop again. The cycle will repeat itself in an infinite loop
// until you quit the bot or it encounters an error.
// The bot will force load a number of options to true/false if they are not already set correct. Just make sure your bot has
// enough gold to afford the items that you have set it to buy.
entryFunc = Shopping;
function Shopping() {
var _idlestartTime = new Date();
var _idlerunTime = 0;
var _tmpdate = new Date();
var _lastdate = new Date() - 60000;
var count = 1;
if (me.gamelength != 0) {
print ("ÿc1Warning: Setting Infinite Game Length!ÿc0");
print ("ÿc1Warning: This module would run in an infinite loop!ÿc0");
me.gamelength = 0;
}
if (YAM_GambleIt) {
print ("ÿc1Warning: Forcing YAM_GambleIt to FALSE for this module!ÿc0");
YAM_GambleIt = false;
}
if (YAM_AlwaysGamble) {
print ("ÿc1Warning: Forcing YAM_AlwaysGamble to FALSE for this module!ÿc0");
YAM_AlwaysGamble = false;
}
// Use the WP to Act 5 if need be
if (me.area != 109) {
YAM_TownManager();
YAM_PathToWayPoint();
DM_UsePortal("Waypoint",0x6d);
YAM_InitCommTown();
}
if (!YAM_VisitAnya) {
print ("ÿc1Warning: Forcing YAM_VisitAnya to TRUE for this module!ÿc0");
me.gamelength = 0;
YAM_VisitAnya = true;
}
if (!YAM_ShopIt) {
print ("ÿc1Warning: Forcing YAM_ShopIt to TRUE for this module!ÿc0");
YAM_ShopIt = true;
}
YAM_TownManager();
while (true) {
count++;
// Go to the portal area and visit Anya
YAM_PathToAnya(); _YAM_Position="anya";
if (YAM_VisitAnya && YAM_ShopIt) {
YAM_NPCinteract(DC_getNPC(512));
}
_idlerunTime = Math.round( (new Date().getTime() - _idlestartTime) /1000);
//make autod2jsp log entry every 2 minutes to zero pingtime, this way autod2jsp will not kill the d2window
//after the "Freeze Timeout Threshold" is over as it resets the counter
_tmpdate = new Date();
if (_tmpdate -_lastdate > 120000) {
_lastdate = _tmpdate;
DC_LogToautod2jsp("Number of Shopping Trips: " + count + " Gametime: " + _idlerunTime);
}
// Enter the red portal to Nihlathak's temple
DM_UsePortal("Portal", 121);
// Enter the red portal to Harrogath
DM_UsePortal("Portal", 109);
}
}
EDIT: Spelling.
Posts: 1,277
Threads: 143
Joined: Mar 2004
Reputation:
0
ey so ur module will just do infinite loop even tho the already bought the item?? well i think this is a good script.. gj caughtemoc
Posts: 352
Threads: 23
Joined: Jan 2005
Reputation:
0
Correct, the script will set an infinite game time and loop itself untill you abort it or it encounters an error. Coding it to stop once a certain item has been bought is very difficult, if not impossible.
EDIT: Spelling.
Posts: 14
Threads: 2
Joined: Oct 2004
Reputation:
0
I dont know if this awould be a yamb thing or a d2jsp thing but it would be nice if there was a script that when your first bot is full it stops and another bot will start until it is full then another then another 1 ect that would be reaaly cool then i could bot when im gone 4 days
Posts: 1,277
Threads: 143
Joined: Mar 2004
Reputation:
0
actually theres a muling module on yamb but it says there untested!!
btw caughtemoc i think that script is great.. but is it possible to go back to malah & larzuk after anya??
Posts: 659
Threads: 14
Joined: Dec 2004
Reputation:
0
If the interface was much neater, like why does it have to be some difficult? Could they make it into one .exe that had like drop down boxes and stuff that setup the bot?
Posts: 352
Threads: 23
Joined: Jan 2005
Reputation:
0
Quote:I dont know if this awould be a yamb thing or a d2jsp thing but it would be nice if there was a script that when your first bot is full it stops and another bot will start until it is full then another then another 1 ect that would be reaaly cool then i could bot when im gone 4 days
That has got more to do with d2jsp than YAMB, so I can't help you with that. The muling script works decent, but it's not worth risking loosing all of your items just because of a small lagg (or whatever).
Quote:btw caughtemoc i think that script is great.. but is it possible to go back to malah & larzuk after anya??
The original ShopBot module that's included with YAMB does exactly this, and uses the waypoint rather than the red portal.
EDIT: Spelling.
Posts: 1,277
Threads: 143
Joined: Mar 2004
Reputation:
0
but the original infinite shop module doesnt detect anya after going to larzuk... it will just say npc unavailable then exit game..
Posts: 352
Threads: 23
Joined: Jan 2005
Reputation:
0
I'll take a look at it later today, when I get home.
EDIT: Spelling.
Posts: 352
Threads: 23
Joined: Jan 2005
Reputation:
0
Sorry for the delay, I've made a small fix to the code, but I have no idea if it makes any difference at all. If it doesn't work, I'll look into it some more, and if I can't fix the script, I'll write an entirely new one.
Code: //Infinite ShopBot Module - by darkspirit
//A YAMB module doesnt have to be coded to kill any bosses. This small module would not kill bosses but would make the bot go to act5 town, shop for the items that you want from npc, go to frigid wp, come back to town through the wp, then shop again. The cycle repeats in an infinite loop until you quit the bot or it encounters an error.
//If you need some magical, non-ethereal items (e.g. +3 warcry spears), it may be faster to acquire them through shopping than through monster killing.
//The bot will force YAM_ShopIt to true if it is not already set. Make sure your bot has enough gold to afford the items that you have set it to buy (also try to set gambleIt to false, otherwise the bot may waste money gambling rather than shopping).
//Set these variables according to your shopping needs in your char config file:
// YAM_AlwaysMalah = true/false Set to true to always visit Malah when in act 5.
// YAM_AlwaysLarzuk = true/false Set to true to always visit Larzuk when in act 5.
// YAM_VisitAnya = true/false Set to true to always visit Anya before killing Pindle if ShopIt is true.
//Remember to set your bmShopIt_XP.ini properly for the items that you want to buy from the vendors.
//
//Steps:
// 1) Make the preparations that I have described above.
// 2) Edit your char config file and add this at the beginning:
//
//YAMXXP.push("Shopping");
entryFunc = Shopping;
function Shopping() {
var _idlestartTime = new Date();
var _idlerunTime = 0;
var _tmpdate = new Date();
var _lastdate = new Date() - 60000;
var count = 1;
print ("Setting Infinite Game Length!");
me.gamelength = 0;
if (!YAM_ShopIt) {
print ("ÿc1Warning: Forcing YAM_ShopIt to TRUE for this module!ÿc0");
YAM_ShopIt = true;
}
print ("Warning: This module would run in an infinite loop!");
// Do town stuff in the act we are in
YAM_TownManager();
// Use the WP to Act 5 if need be
if (me.area != 109) { YAM_PathToWayPoint(); DM_UsePortal("Waypoint",0x6d); YAM_InitCommTown(); }
while (true) {
count++;
// Do town stuff in the act we are in
YAM_TownManager();
if (YAM_VisitAnya) {
YAM_PathToAnya(); _YAM_Position="anya";
YAM_NPCinteract(DC_getNPC(512));
}
_idlerunTime = Math.round( (new Date().getTime() - _idlestartTime) /1000);
//make autod2jsp log entry every 2 minutes to zero pingtime, this way autod2jsp will not kill the d2window
//after the "Freeze Timeout Threshold" is over as it resets the counter
_tmpdate = new Date();
if (_tmpdate -_lastdate > 120000) {
_lastdate = _tmpdate;
DC_LogToautod2jsp("Number of Shopping Trips: " + count + " Gametime: " + _idlerunTime);
}
YAM_PathToWayPoint();
// Do precasts before going into the portal
//XP_Precasts();
// Take WP to Frigid
DM_UsePortal("Waypoint",0x6f);
// Do precasts after going into the portal
//XP_Precasts();
XP_ClearPosition(30);
DM_UsePortal("Waypoint",109);
}
}
EDIT: Spelling.
Posts: 1,277
Threads: 143
Joined: Mar 2004
Reputation:
0
ty caughtemoc, ima try this 1,.. well the only problem with the shop module on yamb was it doesnt recognize anya after going to larzuk, probably bot cant find anya on map,bcuz shes to far from where larzuk was so it just exit game..
|