Commit graph

127 commits

Author SHA1 Message Date
Рома Данилов
3f94814bda
VkMessager: New SendMessage RandomID core (#1198) 2020-08-12 21:47:20 +02:00
Рома Данилов
d33677a245 Update VK API Version 2020-08-10 20:13:20 +02:00
Daenges
92e776cebc
Add Mailer bot (#1108)
* Update for the mail script.

As requested, I added the synchronization between the config debugmessage bool and the one in the script. Furthermore, I added a way to send anonymous mails by writing "tellonym". The messages are saved as normal mails, which lets them count to the mail cap, due to the fact that the host knows the sender.

I added the script to the chat bots because of the problems, that the scripts have with serialization. Instead of rewriting the whole serialization part, my idea was to add the script to the other chat bots, to avoid the compiling issues. Then the serialization would work perfectly fine. Then you could remove the option class at some point and move all the settings to the config file with the addition to activate the whole script.

* Correction of debug message loading.

The object was missing and the change would be overridden a few lines later.

* Update McClient.cs

* Add Mail to config file

* Correcting the safe file.

* Small correction of Settings.c

* Update Mailscript

Added a failsafe version of the path changing commands. If a path could not be found, an error will be created and the path will be reseted to standart, to avoid endless chains of errors.

* Fix for the mail script

Removed a wrong option call. Removed the debug_msg condition around the path functions. => Users are aware of what happened (if they see the error) although they turned off debug_msg.

* Added some features.

Added a try statement to all number changing commands. Added a command to list all moderators to the console.

* Serialization Fix

There was a chance, that if two bots work on one file, and two users send messages in a short time period, that one bot deserializes the message and then the other bot deserialize the same file, before the other one could save its changes. This would lead to one message disappearing, because one bot never deserialized this message. For this I changed the whole serialization process. 
All changes are now committed after the interval and not after an incoming mail command directly. All mails are safed temporarily in cache and get serialized after the interval. Due to this changes, you can determit when the individual bot changes the file (there are no more direct interactions with the file after a command, which lead to a certain randomness). Furthermore you can now set an interval of e.g. 2 mins and reset the interval of one bot with "resettimer" after one minute so that the bots won't disturb eachother and no files get lost.

* My idea of a manual.

This is my idea of a manual for the bot. Improvements of my language / further ideas are welcome! :D

* addIgnored [NAME] and removeIgnored[NAME]

Added an ignored list. Moderators can add players to the list. The bot won't react to them and just log to the console that they are ignored, everytime they are sending a message, to ensure that they are not accidently ignored. (Just if debug_msg is active.)
 Especially useful if there are other chat bots on the server, which spam many messages that aren't useful for the mail system. Or block spammers etc.

* Add the three commands to the manual.

Added addignored, removeignored and getignored to the manual.

* Remove moderators. Implement Console Control.

Due to security concerns, I converted all moderator commands to console internal commands. Thereby only the host can change crucial settings. Special thanks to ORelio for the hint!

* Added empty statement check

Added if to all commands, where the syntax is not already protected by a try, so that an incorrect syntax (Empty args[] due to missing statement) won't crash the script.

* Changed the serialization fail

If the programm can't safe the file, because of some strange character for instance, it first tries to change the path back to normal and if this not helps, it creates a new, file.

* toggle mail sending/receiving

Add an option to turn mailsending and the listening to commands in chat on/off.

* Updated manual.

- Removed moderator commands.
- Removed moderator part in the network manual
+ added the two new commands
+ added a waring for nick plugins and minecraft renames
+ added a small syntax example

* Updated the Settings.cs file.

* Smaller fixes and additions

+ improved command reading of 'mail' & 'tellonym'
+ sorted internal commands alphabetically
+ host can set a maximum message length
+ host can accept commands from public chat
+ host can decide if 'self mailing' (mailing yourself) is accepted
+ new order makes 'getsettings' easier to read
+ new internal commands to toggle 'publiccommands' and 'selfmailing' as well as the maximum mail size
- removed the old command interpreter

* Small improvements and additions

Added a few commands and settings

* Completing getsettings

+ added 'publiccomands'

* Completed getsettings

+ Added 'publiccommand' to 'getsettings'

* Removed single bolean, added Dictionary

- removed all boleans in the option class
- removed all functions relating them
+ added Dictionary for the booleans
+ added a single function to set/toggle all booleans

* Removed Commands, added interpreter

- Removed all Register commands
- removed all integer methods
+ added a single mail command
+ added integer dictionary
+ added integer handling similar like bool handling

* Small fix

+ Changed the numbers in several methods to adjust them to the new syntax.
- removed parameters in several methods, because they got unneccesary

* Even smaller fix

+ Sorted 'getsettings' alphabetically
+ corrected a typo

* New Serialization method.

Now serializing through the .INI format! Thanks to ORelio, who helped me a lot! :)

* Added different time

Added the option to switch between utc and the time of the local machine for timestamps.

* Made timeinutc serializable

Added the bool to the serialization method.

* Adding the INIFile.cs

For Dictionary serialization.

* Reworked ignore feature

Ignored players are now serialized in a file and reloaded, after the bot enters a server.

* Mailer bot refactoring

Rename Mail to Mailer
Move options to MinecraftClient.ini
Make the bot much simpler by removing some settings
Create specific MailDatabase and IgnoreList classes
However the core functionality for users is the same

Settings removed:
 - allow_sendmail: Cannot use Mailer if it's disabled
 - allow_receivemail: Cannot use Mailer if it's disabled
 - path_setting: Settings moved to MinecraftClient.ini
 - debug_msg: MCC already has a setting for that with LogDebugToConsole()
 - auto_respawn: MCC already has a built-in auto-respawn feature
 - allow_selfmail: Is it really necessary to block self mails? ;)
 - maxcharsinmsg: Automatically calculated based on max chat message length
 - timeinutc: DateTime is not show to the recipient so I think it's not absolutely necessary
 - interval_sendmail: Set to 10 seconds for now

Internal Commands removed:
 - changemailpath: Now a static setting in config
 - changesettingspath: Now a static setting in config
 - updatemails: Already updated every 10 seconds
 - getsettings: Shown on startup with debugmessages=true
 - resettimer: Seems only useful for debugging
 - setbool: Settings are static in config file
 - setinteger: Settings are static in config file

All user commands are retained:
 - mail
 - tellonym

* Reload database for mailer network feature

* Merge Mail documentation to Readme.md

Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
2020-08-03 21:44:39 +02:00
Рома Данилов
712875251e
Add UnLoadBot to ChatBot API (#1164)
Add UnloadBot
Add BotList
Update VkMessager
Remove debug info
2020-08-01 14:24:17 +02:00
Рома Данилов
55f8988bbc
Allow DLLs in scripts, Update VKAPI (#1158)
* Update VKAPI
* KeyBoard Update
* Add Custom Libs
* Change add method
2020-08-01 13:02:58 +02:00
Рома Данилов
432f55460d
Fix TreeFarmer (#1157) 2020-07-29 21:52:38 +02:00
Рома Данилов
b5c7dc4fc4
Update SugarCaneMiner.cs (#1156)
Fix
2020-07-29 21:52:15 +02:00
Рома Данилов
e91fefadb3 Fix CobbleMiner 2020-07-29 21:49:59 +02:00
ORelio
e542612e76 Add warnings about bot owner spoofing (#1142) 2020-07-24 12:53:21 +02:00
Рома Данилов
f8111d6b3b Fix VKAPI 2020-07-18 15:12:01 +02:00
Рома Данилов
03388bf5a1
VkMessager bug fix (#1119)
* Update VkMessager.cs

VK API Auto Update Server Key

* Update VkMessager.cs

* Update VkMessager.cs

* Update VkMessager.cs

* Update VkMessager.cs

* Update VkMessager.cs

* Update VkMessager.cs
2020-07-08 21:30:08 +02:00
Рома Данилов
1088e6c4fd
PayKassa bot (#1114) 2020-07-07 19:29:57 +02:00
Рома Данилов
b7b242cff1 Create ClckRuAPI.cs 2020-07-07 19:28:28 +02:00
ORelio
e9f1a4477c Mail ChatBot to Mail script (#1102)
The script compiles but does not work yet due to serialization
2020-07-04 11:01:12 +02:00
Daenges
4f3f217c0f
Fix for the mail script. (#1102)
* New version of the bot.

I improved some things and added the option to change some settings directly through minecraft.

* Update Mail.cs

* Update Mail.cs

* Easy cross server fix.

Besides some other lines, I added a simple way, to setup a cross server system. Through the preconfigured save path, you just need to put two or more instances in the same folder and launch them, to get a cross server mail system.

* Improvement to cross server system.

You are now able to change the directory of the mail/option file inside of the applications folder through mc chat. This means you can run several applications in one folder which are grouped to several safe files and have completely different option settings. (Linking servers in groups or adjust every bot perfectly for the individual server.)
2020-07-04 10:39:37 +02:00
Daenges
f58798df61
Add script to let the bot act like a mail plugin. (#1098)
This script lets the bot act like a mail plugin. You can send mails through private messaging the bot with "sendmail [Text]". You can configure many options in the option class. If you want to, you can point several instances to one file and create a cross server mail system, with each bot perfectly configured for the individual server.
2020-07-01 19:29:33 +02:00
ORelio
09bfe92071 Fix Miner/Farmer addon scripts (#1047) 2020-06-13 23:47:53 +02:00
ORelio
ee96788019 Add CobblestoneMiner and TreeFarmer by Nekiplay (#1047) 2020-06-12 00:12:36 +02:00
ORelio
fa0f91aad8 Sugar Cane Miner Improvements by NekiPlay (#1047) 2020-06-12 00:10:57 +02:00
Grant Emsley
7d3e7f66f6 Add %login% variable 2020-06-09 23:22:22 +02:00
ORelio
674bf4f635 Add SurgarCaneMiner by Nekiplay (#1047) 2020-06-07 23:37:17 +02:00
ORelio
1c1d137ab7 Add example of async HTTP request (#1041) 2020-06-07 23:36:56 +02:00
ORelio
9dae40153c Implement pull request #982
LookAtLocation and AutoLook
2020-05-01 14:02:23 +02:00
ORelio
e4cae97dd7 ConsoleIO: Rewrite backspace handling
Manually move the cursor instead of using the backspace character.
Should help when deleting characters requiring multiple keypresses
like Chinese characters. Fix attempt for #941
2020-04-15 14:54:36 +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
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
e4e1f0b9fa Update README.md 2020-03-27 13:10:37 +01:00
ReinforceZwei
2b76de167b Update README.md 2020-03-27 13:10:37 +01:00
ReinforceZwei
bc449b404e Inventory handling 2020-03-27 13:10:37 +01:00
ReinforceZwei
fa51d9632d update to newest version 2020-03-24 19:23:59 +01:00
ReinforceZwei
221d2525be inital commit for auto attack 2020-03-24 19:23:59 +01:00
ORelio
758bc2ad49 Add sample-script-with-http-request
Made as an example for #887
2020-03-17 00:15:53 +01:00
Dusan Milutinovic
3995cf9c2b Update and rename README.txt to README.md
Added detailed explanation for C# scripts.
Added new better styling which is easier to read
2020-02-11 20:59:36 +01:00
ORelio
c04b17cabc Implement Terrain and Movements for MC 1.13
Special thanks to @TheSnoozer and @vkorn for their help!

 - Implement global block Palette mechanism
 - Add class generation tool from blocks.json
 - Regenerate Material.cs and redefine solid blocks
 - Migrate previous Material.cs into Palette112
 - Generate Palette113 from MC 1.13.2 blocks.json
 - Improve Block class to handle up to 65535 block states
 - Adjust terrain parsing, small fixes in packets
 - Remove unused snapshot-related protocol cases

Solves #599
2019-04-25 22:19:50 +02:00
ORelio
d0088e0dca Update player look when using pathfinding
Document Look command in Readme
Improve UpdateLocation API
Small coding style fixes
2019-04-12 17:11:41 +02:00
yangciou
758bfad501 Spelling/typo mistake at line 27 2018-02-13 08:42:59 +01:00
ORelio
ffb1adeb4d Add login request and response debug messages
See #269

+ Add exaxct mono packages in README, thanks @Pokechu22 for that
2017-04-17 15:58:46 +02:00
ORelio
6505fcccb3 Add 'Debug' command for toggling debug messages
See #223
2017-03-15 19:14:58 +01:00
ORelio
693073edfc Replace DnDns with HeijdenDns
HeijdenDns seems to do a better job at querying SRV records
2017-03-11 15:28:32 +01:00
ORelio
e72580bcb6 Add new sample script: PM forwarder
Suggestion by GetPots
2016-10-23 11:24:43 +02:00
ORelio
69542872d0 Update README with more license and credit info
- Add License Info
 - Add Contributors
 - Add Libraries
 - Add Links
2016-10-06 19:12:53 +02:00
ORelio
2a07fbbae6 Remove tab display name experiment (not working)
- Tab display names should hold display name but...
 - Server sends <UUID, name, null> x Player count
 - TabListPlus sends <SlotID, ???tab#01, SlotText> x Slot Count
 - So we don't have player display names, only worthless slots
 - So the whole feature was useless, reverting to name only.
2016-08-27 15:46:34 +02:00
ORelio
9a98a9d46f Store extended player info, list display names
- Add 1.10.1 and 1.10.2 in supported version list
 - Store both player name and player display names
 - List command will sort players by player name
 - List command will now display by display name
 - Ability to use /list raw to display by real name

Suggestion by Johngreen123
2016-08-22 19:40:58 +02:00
ORelio
a4cc36ce05 Allow restricting AutoRespond matches to bot owner
Suggestion by AppleCidar in #184
2016-08-21 19:53:31 +02:00
ORelio
67fc431d4a Add location getter and setter location in ChatBot
See #146
2016-05-04 23:47:08 +02:00
ORelio
75bbeb0b4b Fix write conflicts for disk session cache
Will use random waits when a write conflict is detected.
This should allow several clients to write at the same time.
Inspired from CSMA/CD (ethernet way of handling collisions).

Bug report by TNT-UP @ MC Forum post no.1684
2016-03-21 11:03:31 +01:00
ORelio
96e4c589cd Update README file 2016-03-21 10:22:05 +01:00