Code Monkey home page Code Monkey logo

alclient's People

Contributors

earthiverse avatar kevinsandow avatar oliver-cool-beans avatar stormsurge95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

alclient's Issues

More filters for `Character.locateItem()`

  • returnLowestQuantity
  • returnHighestQuantity

And somehow, for Character.locateItems(), a way to return items of a specific slot type.
It's a bit tricky for weapons since we have to figure out a way to return items that match a specific class, too.

Use HTTPS

ALClient should probably use HTTPS by default

Updating Character Object

After running the ff. code

const warrior = await AL.Game.startWarrior('character', 'ASIA', 'I')
await warrior.smartMove(entity)

Expected
warrior.moving === true
But returned false.

After inspecting the code further , I found out that what was updated is the entities Map within the warrior object.

Is this the expected behavior? If so, I'd like to update the code so that we could update the character object data i.e. warrior.moving so that we can easily get player information

wtf

return Math.min(1.32, Math.max(.05, 1 - (.001 * Math.max(0, Math.min(100, a)) + .001 * Math.max(0, Math.min(100, a - 100)) + .00095 * Math.max(0, Math.min(100, a - 200)) + .0009 * Math.max(0, Math.min(100, a - 300)) + .00082 * Math.max(0, Math.min(100, a - 400)) + .0007 * Math.max(0, Math.min(100, a - 500)) + .0006 * Math.max(0, Math.min(100, a - 600)) + .0005 * Math.max(0, Math.min(100, a - 700)) + .0004 * Math.max(0, a - 800)) + .001 * Math.max(0, Math.min(50, 0 - a)) + .00075 * Math.max(0, Math.min(50, -50 - a)) + .0005 * Math.max(0, Math.min(50, -100 - a)) + .00025 * Math.max(0, -150 - a)))

would you accept a pr that makes this readable?

Force disconnect command

In-game the code calls cruise 300 times quickly to force a disconnect.
This is sometimes useful, it should be added in ALClient, too.

alclient-mongo repo

First off, this is an awesome project!

I'd love to contribute to the alclient-mongo package, is there a repo for that project? I wouldn't mind pitching in and combining the two into a monorepo so they can share code.

Thanks!

Cannot `smartMove` to `goo`

Replicate by
smartMove('goo')

ERROR Cannot read properties of undefined (reading 'id')
here

if (options?.showConsole) console.debug(`Looking for a path from ${fromNode.id} to ${toNode.id} (from ${from.map}:${from.x},${from.y} to ${to.map}:${to.x},${to.y})...`)

and wherever else toNode.id is referenced after

It happens before the toNode is undefined here
getPath can't seem to find a path for { map: 'goobrawl', x: 8, y: -132 }

const toNode = this.findClosestNode(to.map, to.x, to.y)

Can add a null check here, but why has it broken all of a sudden?
Is this just me?

Monster hunts

For some reason monster kills I get with alclient do not go towards the monster hunts I get from Daisy. Is there a way around this?

I am able to have monster kills count when I manually hunt the monsters. Do you know if browser-based bots have this issue by chance?

Add Custom Logger

Currently; the "best" option for logging packages looks like Winston as we can customize nearly everything about it fairly easily. At the moment though, my only hiccup is: how do we want format of the logs to look? Do we want timestamps? Do we want to show the level(s) of the log(s)? Do we want to be able to prettyprint JSON? Do we want basic coloring (as in just the log levels and/or the entirety of the message) or do we want advanced coloring (as in specific colors for JSON printing)?

Just to place a first suggestion: <hours>:<minutes>:<seconds>:<milliseconds> <level> [<character ID>]: <message>

MongoBulkWriteError: E11000 duplicate key error collection

MongoBulkWriteError: E11000 duplicate key error collection: ..._alclient.entities index: serverRegion_1_serverIdentifier_1_name_1_type_1 dup key: { serverRegion: "US", serverIdentifier: "III", name: null, type: "mrpumpkin" }

This happens to mrpumpkin & mrgreen, in both cases the key part name is null.

So it's obviously this index that raises the issue:

EntitySchema.index({ name: 1, serverIdentifier: 1, serverRegion: 1, type: 1 }, { unique: true })

ReferenceError: exports is not defined in ES module scope

ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and 'C:\Users\user\Documents\alclient-test\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

"esModuleInterop": true is set.
"type": "module" is set.
node version 16.13.2- though I tried on 16.5 and 17 as well.

Combine alclient and alclient-mongo

I'd like to contribute to the code but maintaining two branches makes this process cumbersome for everyone. Perhaps the mongo branch should be merged to master and there can be an option to enable mongodb logging. What do you think?

Can't run sample script

That's the error I'm getting while trying to run sample code from README.

`PS J:\ALC> npx tsc main.ts
main.ts:1:8 - error TS1192: Module '"J:/ALC/node_modules/alclient/build/index"' has no default export.

1 import AL from "alclient"
~~

node_modules/alclient/build/Pathfinder.d.ts:2:8 - error TS1192: Module '"J:/ALC/node_modules/ngraph.path/index"' has no default export.

2 import path from "ngraph.path";
~~~~

Found 2 errors.`

My sample code:
`import AL from "alclient"

async function run() {
await Promise.all([AL.Game.loginJSONFile("../credentials.json"), AL.Game.getGData()])
await AL.Pathfinder.prepare(AL.Game.G)

const merchant = await AL.Game.startMerchant("Seler", "ASIA", "I")
console.log("Moving to main")
await merchant.smartMove("main")
console.log("Moving to cyberland")
await merchant.smartMove("cyberland")
console.log("Moving to halloween")
await merchant.smartMove("halloween")

merchant.disconnect()

}
run()`

Class-agnostic char interface?

is there a single interface for all classes that one could use? i don't want to duplicate code on migration for different classes. atm it's just one code for all chars.

EDIT: just saw hardcoded skills per class - so probably not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.