Commit graph

85 commits

Author SHA1 Message Date
ReinforceZwei
a51368a859 Add a proof of concept working demo 2020-07-23 19:19:32 +02:00
Рома Данилов
fb50b0d5cb
ChatBot API: OnScoreboardObjective, OnEntityEffect, OnUpdateScore, EntityInteract, Hand list (#1097)
* Create Effect.cs
* Rename Effect.cs to Effects.cs
* Update MinecraftClient.csproj
* Update Effects.cs
* Update Effects.cs
* add EntityEffect
* Update McClient.cs
* Update Protocol18.cs + EntityEffect
* Update IMinecraftComHandler.cs
* Update Protocol18PacketTypes.cs + EntityEffect
* Update ChatBot.cs + OnEntityEquipment
* Update PacketIncomingType.cs + ScoreboardObjective
* Update Protocol18PacketTypes.cs
* Update Protocol18.cs
* Update IMinecraftComHandler.cs + OnScoreboardObjective
* Update McClient.cs + OnScoreboardObjective
* Update ChatBot.cs + OnScoreboardObjective event
* Update Protocol18.cs: fix scoreboard
* Update McClient.cs
* Update ChatBot.cs
* Update PacketIncomingType.cs
* Update ChatBot.cs + OnUpdateScore
* Update McClient.cs + OnUpdateScore
* Update IMinecraftComHandler.cs + OnUpdateScore
* Update Protocol18.cs
* Update Protocol18PacketTypes.cs
* Update Protocol18.cs + fix micro lags
* Update Protocol18.cs
* Update Protocol18.cs
* Update Protocol18.cs
* Update Protocol16.cs
* Update Protocol18.cs
* Update McClient.cs
* Update IMinecraftCom.cs
* Update McClient.cs
* Update McClient.cs
* Update McClient.cs
* Update ChatBot.cs + GetEntities()
* Create Hand.cs
* Update MinecraftClient.csproj
* Update McClient.cs
* Update ChatBot.cs
* Update Protocol18.cs
* Update ChatBot.cs
* Update ChatBot.cs
* Update ChatBot.cs
* Update ChatBot.cs
* Update ChatBot.cs: fix
* Update AutoAttack.cs: Fix
* Update McClient.cs: compile fix
* Update ChatBot.cs
* Update AutoAttack.cs
* Update ChatBot.cs
* Update Protocol18.cs
* Update IMinecraftComHandler.cs
* Update McClient.cs
* Update ChatBot.cs
* Update Protocol18.cs
* Update IMinecraftComHandler.cs
* Update ChatBot.cs
* Update McClient.cs
* Update McClient.cs: remove check distance
* Update EntityActionType.cs: more actions
* Create CommandBlockMode.cs
* Create CommandBlockFlags.cs
* Update IMinecraftCom.cs
* Update McClient.cs
* Update ChatBot.cs
* Update Protocol18.cs
* Update Protocol16.cs
* Update PacketOutgoingType.cs
* Update Protocol18PacketTypes.cs
* Update Protocol18.cs
2020-07-04 10:45:51 +02:00
ORelio
2add4030f4 Rename McTcpClient to McClient for clarity
+ Fix compile error in #1071
2020-06-20 15:01:17 +02:00
ReinforceZwei
ab05d697ef
Fix AutoEat crash (#1068)
* Fix AutoEat keep eating after player dead
* Fix null reference on GetInventory method
* Add error handle for ChatBot API events
* Fix minor mistakes
2020-06-14 15:14:51 +02:00
ORelio
20fb2323a4 Read all files as UTF-8 (#1035)
Fix encoding issues with some languages such as Chinese
by forcing UTF-8 everywhere. Configuration files written
in ANSI/Latin-1 and other encodings will need conversion.
2020-05-29 20:23:03 +02:00
Рома Данилов
cf9bc4c3d5
Add SendPlaceBlock, PlayerDigging, OnExplosion, OnGamemodeUpdate, OnSetExperience (#1027)
* Update ChatBot.cs

+ PlaceBlock

* Update AutoAttack.cs

+ HitAnimation

* Update PacketIncomingType.cs

+ Explosion,

* Update McTcpClient.cs

+ OnExplosion

* Update ChatBot.cs

+ OnExplosion

* Update IMinecraftComHandler.cs

+ OnExplosion

* Update Protocol18PacketTypes.cs

+ PacketIncomingType.Explosion

* Update ChatBot.cs

+ Fix

* Update AutoAttack.cs

+ Fix

* Update ChatBot.cs

+ Fix

* Update Protocol18PacketTypes.cs

+ Old versions

* Update Protocol18PacketTypes.cs

+ 1.7 - 1.8 Explosion ID

* Update Protocol18PacketTypes.cs

+ Fix

* Update McTcpClient.cs

+ int ExplosionRecordCount

* Update ChatBot.cs

+ recordcount

* Update IMinecraftComHandler.cs

+ ExplosionRecordCount

* Update Protocol18.cs

* Update CSharpRunner.cs

+ using MinecraftClient.Inventory;

* add OnGamemodeUpdate

+ OnGamemodeUpdate

* + OnGamemodeUpdate(playername, uuid, gamemode)

+ OnGamemodeUpdate

* Update Protocol18.cs

* Update IMinecraftComHandler.cs

* Update McTcpClient.cs

Fix

* Update McTcpClient.cs

* Update Protocol18.cs

+ Location explodelocation

* Update McTcpClient.cs

+ Location explode

* Update ChatBot.cs

+ Fix

* Update ChatBot.cs

Remove excess +

* Update Plays animation

* Improve documentation

* ItemType fix

* OnExplosion(Location explod);

* Update PacketIncomingType.cs add SetExperience,

* + Old versions

* Update IMinecraftComHandler.cs

* Update McTcpClient.cs

* Update Protocol18.cs

* add GetLevel & GetTotalExperience

* Fix

* add GetLevel & GetTotalExperience

* OnSetExpience

* Update ChatBot.cs

Fix

* Update McTcpClient.cs

+ bot.OnSetExperience

* Update Protocol18.cs

+ Fix

* Update McTcpClient.cs

+ PlayerDigging

* Update PacketOutgoingType.cs

+ PlayerDigging

* Update Protocol18PacketTypes.cs

+ case PacketOutgoingType.PlayerDigging

* Update Protocol18.cs

+ SendPlayerDigging

* Update IMinecraftCom.cs

+ SendPlayerDigging

* Update McTcpClient.cs

+ PlayerDigging

* Update Protocol16.cs

+ SendPlayerDigging

* Update ChatBot.cs

+ PlayerDigging

* Update ChatBot.cs

+ Fix

* Update McTcpClient.cs

+ Fix

* Update ChatBot.cs

Add WindowAction

* ChatBot.cs Fixes

* Further ChatBot.cs fixes

* Further ChatBot.cs fixes

* Protocol Handler fixes

* Protocol Handler fixes

* IMinecraftCom fixes

* documentation fixes

Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
2020-05-29 20:18:34 +02:00
ORelio
bd85c46663 Implement entity types (#1001)
Implement palette generation and investigate palette changes between
versions. Turns out 1.13- has legacy IDs, 1.14 switches to entity
palette and 1.15 refreshes the whole palette just to insert Bee.

Also refactor entity handling code here and there.
2020-05-24 18:21:22 +02:00
Reinforce Zwei
cdb217840d Remove unused using 2020-05-22 17:30:02 +02:00
Reinforce Zwei
06ed5c0a45 Fix #1006 2020-05-22 17:30:02 +02:00
CarbonNeuron
5fdbff94c7 Rename Result to result to be compliant. 2020-05-03 11:18:18 -05:00
CarbonNeuron
bb5ea0280a Get rid of String interpolation, replace with string format. 2020-05-03 10:56:55 -05:00
CarbonNeuron
2fdb89c11a Change OnlyInternal to OnlyInternalCommands 2020-05-03 10:55:55 -05:00
CarbonNeuron
c5a19f4b8b Get rid of UseItemOnHand in using chatbots, replace with UseItemInHand 2020-05-03 10:49:51 -05:00
CarbonNeuron
02ebf067b9 Add Internal command logging. 2020-05-01 09:37:15 -05:00
CarbonNeuron
16959d6e65 Remove AutoLook.cs Chatbot because it is not in main project. Also removes it in McTcpClient.cs, and gets rid of the Settings.cs and Default paramaters. 2020-05-01 09:02:15 -05:00
CarbonNeuron
384c804e54 Added Entity Action handling, and A TSneak command that will Toggle Sneak. 2020-05-01 08:28:22 -05:00
OverHash
770a82e2d2 Check player is in range each entity attack
This commit should make it so that MCC will check that the player is in range before attacking entities each iteration of the cooldown.

This was problematic before, because, if the entities were still they would be added to the attack list, and then if they stayed still and the client teleported away, it would still attempt to attack the entities, even though it is now out of range.
2020-04-27 18:35:59 +02:00
ORelio
7f1ad036b1 AutoAttack coding style fixes 2020-04-27 18:35:59 +02:00
OverHash
83852511bc Don't attack entities whilst dead
MCC will now not attempt to attack entities if the client is dead
2020-04-27 18:35:59 +02:00
OverHash
a378089f1b Clean AutoAttack
A lot of this code is messy and has unused variables. Additionally, there are memory leaks as dead entities are not removed from meory.
2020-04-27 18:35:59 +02:00
ReinforceZwei
0acb17e105 Make AutoEat not to use Threading 2020-04-13 17:49:24 +02:00
ReinforceZwei
3e76baeeb1 Fix AutoAttack stop working with AutoEat enabled and no food on hotbar
#934
2020-04-13 17:49:24 +02:00
ReinforceZwei
8e32c3747c Revert "Improve AutoEat"
This reverts commit 51f54979da.
2020-04-13 17:49:24 +02:00
ReinforceZwei
e9d91ce572 Improve AutoEat 2020-04-13 17:49:24 +02:00
ReinforceZwei
3f9b084a45 Remove IsFood method from Item class 2020-04-09 20:50:34 +02:00
ReinforceZwei
b1121e91e3 Add Item type extension 2020-04-09 20:50:34 +02:00
ReinforceZwei
97b0b03c33 Move AutoEat to a ChatBot 2020-04-09 20:50:34 +02:00
ReinforceZwei
2e1e79bcef Add AutoEat
#923
2020-04-09 20:50:34 +02:00
ORelio
7b049576a3 Allow single commands in ScriptScheduler
Replace script= with action= like in AutoRespond
Older script=<text> will be handled as action=script <text>
2020-04-02 19:00:38 +02:00
ORelio
c5b0f447c9 AutoRelog: Allow any kick message
Set ignorekickmessage=true in config
See issues #880 #921
2020-04-02 18:27:18 +02:00
ORelio
b01c50b792 Improve logging, auto respawn
See discussion in GitHub issue #918
2020-04-01 21:15:35 +02:00
ReinforceZwei
9dbb70eb63 Fix tps not updated 2020-03-31 15:40:41 +02:00
ReinforceZwei
c581ac95c3 Fix AutoFish crashs on EntityDespawn
Issues #902
2020-03-30 20:22:40 +02:00
ORelio
bc3d6aba00 Implement item types
Github discussion on commit 6929ae236a
2020-03-28 23:30:42 +01:00
ORelio
195e162c7d Add code documentation, move and rename a few methods 2020-03-28 00:48:41 +01:00
ORelio
00112e4c6a Give access to AutoRespond matches inside scripts
Available as %match_u%, %match_1% and so on
See #770 for initial suggestion
See #772 for in-progress implementation
2020-03-27 21:39:06 +01:00
ReinforceZwei
66afe127cb AutoFish now checks if the fishing hook is ours 2020-03-27 13:10:37 +01:00
ReinforceZwei
bc449b404e Inventory handling 2020-03-27 13:10:37 +01:00
ReinforceZwei
7fbf9443a1 Made ChatBotAPI OnEntityDespawn to pass Entity object instead of EntityID 2020-03-24 19:23:59 +01:00
ReinforceZwei
dbf5334758 Moved Auto attack and auto fishing to ChatBots and added ChatBotAPI for entity handling 2020-03-24 19:23:59 +01:00
ReinforceZwei
8c31c04c3e Tidy up code
Move variable declaration to the top
Delete unnecessary kill.cs file
2020-03-24 19:23:59 +01:00
ReinforceZwei
0b0e3c334e auto attack 2020-03-24 19:23:59 +01:00
ORelio
52d98538b3 Fix AutoRelog running twice on disconnection
Bug introduced in commit aaf1e8311b
Implement User-Initiated logout reason to ignore the second logout event
See #817
2019-12-08 22:24:20 +01:00
TheSnoozer
3393e7e402 report the full path when loading any files which might help in troubleshooting files not found properly 2019-09-23 22:32:28 +02:00
ORelio
237353498c Fix TriggerOnLogin in ScriptScheduler w/ AutoRelog
Thanks @Nafana for pointing it out in #629
2019-08-04 15:52:44 +02:00
ORelio
e7c664648e AutoRelog: Hide "Loaded message:" lines by default
when debugmessages=false (#740)
2019-05-30 11:48:57 +02:00
ORelio
9372d81738 AutoRelog: Add debug messages (#740) 2019-05-30 11:45:43 +02:00
ORelio
ecf0114f62 ConsoleIO: Sync with SharpTools
Had 2 versions of the ConsoleIO class, one here inc MCC (the original),
and another one in SharpTools, more generic, for use in other projects.

Both had diverged, this commit imports changes from the other repository.
This should not have any particular effect on MCC, besides adding more
documentation and settings in the source code of the class.

If any issue arises, as always, please report it :)
2018-05-28 22:09:50 +02:00
ORelio
1cecf2d788 Improve debug output for HTTPS requests
For diagnosing session errors in #450 and #451
2018-05-23 19:07:31 +02:00
ORelio
79aaa04775 ScriptScheduler: Add debug messages for issue #431
These messages will only apprear if debugmessages=true in config.
2018-05-08 19:27:19 +02:00