Jordan2310 0 Share Posted January 1, 2020 Hi I am new at writing scripts trying to learn I have write a basic goblin script that just attacks goblins but I won’t to 1 set up a level cap so like when it has 10 attack Strength and defence I want it to change to a different NPC how to I put it into Code formAnd where would I put it in the codeAnd I wanted to swap from attack to strength to defence so we can level each one Link to comment Share on other sites More sharing options...
Defiled 424 Share Posted January 2, 2020 Hi, I'd advise that you learn Java first then learn the DreamBot API. But for what you asked for.. For NPC Level Switches: if(getSkills.getRealLevel(Skill.ATTACK) >= 10) { goblin code here } else if(getSkills.getRealLevel(Skill.ATTACK) >= 20) { other npc code here } etc.. For Combat Style Switches: Use PlayerSettings, I think the config is 46.. not sure Here is a well made snippet for that made by @Infidel I hope this helps! Link to comment Share on other sites More sharing options...
Jordan2310 0 Author Share Posted January 2, 2020 2 hours ago, Defiled said: Hi, I'd advise that you learn Java first then learn the DreamBot API. But for what you asked for.. For NPC Level Switches: if(getSkills.getRealLevel(Skill.ATTACK) >= 10) { goblin code here } else if(getSkills.getRealLevel(Skill.ATTACK) >= 20) { other npc code here } etc.. For Combat Style Switches: Use PlayerSettings, I think the config is 46.. not sure Here is a well made snippet for that made by @Infidel I hope this helps! Thanks you so much for your help just got to find out where I put this I’m my script and there is no good tutorial out there for all this kind of stuff anymore Link to comment Share on other sites More sharing options...
Jordan2310 0 Author Share Posted January 2, 2020 6 hours ago, Jordan2310 said: Thanks you so much for your help just got to find out where I put this I’m my script and there is no good tutorial out there for all this kind of stuff anymore 9 hours ago, Defiled said: Hi, I'd advise that you learn Java first then learn the DreamBot API. But for what you asked for.. For NPC Level Switches: if(getSkills.getRealLevel(Skill.ATTACK) >= 10) { goblin code here } else if(getSkills.getRealLevel(Skill.ATTACK) >= 20) { other npc code here } etc.. For Combat Style Switches: Use PlayerSettings, I think the config is 46.. not sure Here is a well made snippet for that made by @Infidel I hope this helps! Where would I put the code in my script and when you say goblin code here what code would that be sorry to be a pain Link to comment Share on other sites More sharing options...
Defiled 424 Share Posted January 2, 2020 2 hours ago, Jordan2310 said: That code is an example for what you should do, that isn't something you can copy paste.. But.. goblin code is the code for the goblin killer.. And yes.. there isn't a lot of tutorials on scripting in terms of the API but there is a ton of Java Tutorials online.. I suggest that you learn Java before attempting to script then learn the API getSkills().getRealLevel(Skill.SKILLNAME) <-- That gets the REAL level of the Skill (without any boosts) so you can just put that in an if statement and go nuts Link to comment Share on other sites More sharing options...
Jordan2310 0 Author Share Posted January 2, 2020 1 hour ago, Defiled said: That code is an example for what you should do, that isn't something you can copy paste.. But.. goblin code is the code for the goblin killer.. And yes.. there isn't a lot of tutorials on scripting in terms of the API but there is a ton of Java Tutorials online.. I suggest that you learn Java before attempting to script then learn the API getSkills().getRealLevel(Skill.SKILLNAME) <-- That gets the REAL level of the Skill (without any boosts) so you can just put that in an if statement and go nuts You definitely know your stuff thanks for all the help I’m going to learn java first like you said that should give me more of a understanding of what I need to do Link to comment Share on other sites More sharing options...
Defiled 424 Share Posted January 2, 2020 2 minutes ago, Jordan2310 said: You definitely know your stuff thanks for all the help I’m going to learn java first like you said that should give me more of a understanding of what I need to do Thank you That's so nice of you to say! and yes, you should know Java before entering into scripting.. makes your life way easier.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.