minebot Minebot开源项目

我要开发同款
匿名用户2021年11月08日
24阅读
开发技术Python
所属分类应用工具、IM/聊天/语音工具
授权协议GPL-3.0 License

作品详情

minebot

Minebotisamodforminecraftthattakescontroloftheplayerandautomaticallydoestasksforyou.Itsimulateskeyboardandmouseinputtointeractwiththeword.

Minebotiswrittentobeplayedonnormalminecraftinsurvivalmode.Creativemodeandsomemodspartiallyworkbutarenottargeted.

Thebotiscontrolledbygivingitcommandsusingthechatline.Foradvanceduses,itcanbecontrolledusingsimplescriptsortheJavascriptAPI.

HavealookattheGettingStartedWikiPagetoseehowtousethebot.

Thisrepoalsocontainsanindependentbowaiminghelper.

Download+Installing(Stableversion)

InstallForgemodloader.

Getthelatestrelease.

ExtracttheZIPfileandputthejarfilesinyourminecraftmodsdirectory.

GettingHelp

Usetheissuetrackerforbugsortogethelpwithyourstuff.I'mnotavailableintheminecraftforumanymore(it'sjusttoslowandblown-up).

Building(Latestversion)

Thedeveloperversionmaycontainmorebugsthantherealversion.

BuildingMinebotisstraightforward.Youneedlinux,gitandthenormaljavadevelopmenttools.

Clone/DownloadthisrepoRun./release.shExtractthatZIPfileinyourminecraftmodsdirectory

Ifyouencounterexceptionsduringthebuild,tryrunningthisintheminebotdirectory:./gradlew--no-daemonbuild

DevelopingMinebot

Iwon'tdevelopthismodanyfurther.Minecraft1.8.9isthelastsupportedversion.AbaiscbutincompleteportisavailableforMinecraft1.11.2.ButIwillbeacceptingPRstothisrepository.

Iuseeclipseneonfordevelopment.YoucansimplyimportMinebotasexistingproject.

==================Messagefrom1.16.3Porter(Vaccinate)=============SomekindoflawmessagesayingI'mnotresponsibleifyougetbannedforbottinganywhereetc.Notaccountableforanythingthatgoeswronghere,it'syourchoiceifyouchoosetousethecodeandalltheconsequencesofdoingso.IwasmainlyfocusedonMinebotandnotAimBow.Anotherpoint:Therearesomeslightmappingissueswithfunctions,dotakealookatdocumentationhttps://forge.yue.moe/javadoc/1.16.3/overview-summary.htmlhttps://gist.github.com/gigaherz/2dfa77c6efc7d1248ef88ec1920c0a93#file-1152to1161-xmlEspeciallyhelpfulfor1.16.3developmentlinks.

UsingIntelliJIDE&Gradle:Settingup:Ihavecommentedoutthemapsandthestatssections-Ididdeleteinsteadofcommentoutsomecode(Iknow,mybad)butifyoulookthroughthefirstcommitandctrl-Fformapandstatsyoushouldfindmostofthecalls.Step1:ClonetherepoStep2:OpentheprojectwithIntelliJStep3:InsideIntelliJ,Navigatetominebot/Minebot/src/build.gradleStep4:Rightclickitandselect"ImportGradleProject"Step5:Thatshouldopenasectionwiththegradleproject,Minebot,andalittleelephanttotheleftStep6:ExpandMinebot,Tasks,fg_runs,genIntelliJRuns.Step7:Doubleclick,itwillsetyourIntelliJuptobereadytorunMinecraftandimporttheprojectStep8:ExpandMinebot,Tasks,fg_runs,doubleclickrunClientStep9:WheninIntelliJ,SetupyourSDKtouseJava1.8(Ibelieveit'stheonlyoneworkingwithMinecraftatthegiventime)ThiswillrunthecodeandopenaMinecraftlauncherwiththisversionofMinecraftonit.Happydevelopment!

IfI'mgonewhenitcomestoimplementing1.17.xorfutureversions,essentially:Firstyouneedtoupgradethebuild.gradleandthemods.toml.ThesecanbefoundinMinebot/src/main/resources/META-INF.For1.16.3itwasimportantthatweupdatedthemods.tomltoincludealicense="x"portionformodstorun.IassumeditwasGNUbasedonMichael'scomments.Whenyou'rehere,increaseloaderVersion="[xx,)"tothevalidonefortheversion.Ifyou'renotsure,findsomeothermod'sgithubandcheckwhatthey'reusingfortheversionyou'retryingtoportto.

Then,you'llneedtoupdatethebuild.gradle-onceagainseewhatothermoddersusehere,butlookformappingschannel:'snapshot',version:'xxxx'foryourversionandthenthedependencies{minecraft'...'}needsyourforgeversioninit.

Now,youcan"Reimportallgradleprojects"inyourIntelliJGradlewindow(Abovethelittleelephant)

Iftherearemanyerrors,unlucky.Gothrougheachonebyone-ifit'safaultimport,lookforthenewmappinginthedocumentationforyourversion.SeeoneofthelinkstoknowwhatI'mtalkingabout.Then,onebyone,replaceallreferencestoit.Goodluck&Happycoding,

Vaccinate04/11/2020=====================EndMessagefrom1.16.3Porter=========================

ThemainclassesofMinebothavesomeJavadocinthem.Mostotherclassesareundocumentedbutshouldexplainthemselves.

Howtoaddanewcommand:

AddanewcommandclassandregisteritinAIChatController.TheclassneedsanAICommand-Annotation.Mostcommandsuse"minebot"asbasecmmand.AtatleastonemethodwithanAICommandInvocation-Annotation.Addparameterstothatmethod.EachparameterneedsaAICommandParameter-Annotationthatisusedtogeneratethehelptextandtabcompletion.Itcanhaveanysupportedtype(int,enums,color,block,...)butshouldnotallowambigiouscommandlines.Implementthatmethod.Youcaneitherimplementastrategythatshouldnowbeusedordothestuffdirectlyinthemethod.

Howtoimplementanewstrategy:

LetanewclassextendTaskStrategyImplementthesearchtaskmethod.ItshouldsearchnewstufftodoandsendthetaskstothepassedAIHelpercallingit'saddTaskmethod.Ifitdoesnotsendanytasks,itisfinished.Mindthat,duetoserverlagsorotherproblems,thesearchmethodmightbecalledbeforeallpreviouslyassignedtaskshavebeenworkedon.Youshouldhandlethis.

Howtoimplementanewsearchingstrategy(thefastway)

ExtendMovePathfinder.Lookattheotherexamplesonhowtodoit,basicallyyoujusthavetorateeachdestinationandcanaddataskthatshouldbedonewhenadestinationisreached.Alwaysworkonthelocalworldobjectwhenpathfinding.Thisallowsthebottopre-searchtaskswhileitisstillworkingontheoldones.

Howtoimplementanewtask:

LetaClassextendanAITaskAddaisFinishedmethodthatreturnstrueifthetaskisdone.AddarunTickmethod,thatiscalledeverytickandshouldworktowardsthegoal.YouwillfindalotofhelpfulmethodsintheAIHelper.Therearemanyoptionalmethods.HavealookattheAITaskdocumentation.
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论