beatzunknown / ModPE_Scripts

My Minecraft PE ModPE Scripts
MIT License
7 stars 6 forks source link

Help please :) #1

Closed AndreyNazarchuk closed 8 years ago

AndreyNazarchuk commented 9 years ago

At this part of he code: menuLayout.addView(button);

        //Add more buttons in this section

I cannot figure out how to add a new button because I don't know what is the EXACT code for it, Plus This is confusing me: menuLayout.addView(button); I cannot figure out if that's the start of the new button or the end of the old one

beatzunknown commented 9 years ago

var button = new android.widget.Button(ctx); button.setText("Button"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ //Your Code } })); menuLayout.addView(button);

This is your first button. To make another one you would "clone" it with another variable name. Let's call it button2.

var button2 = new android.widget.Button(ctx); button2.setText("Button"); button2.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ //Your Code } })); menuLayout.addView(button2);

AndreyNazarchuk commented 9 years ago

Thanks so much! No wonder it was crashing!

On Monday, November 24, 2014, BeATz-UnKNoWN notifications@github.com wrote:

var button = new android.widget.Button(ctx); button.setText("Button"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ //Your Code } })); menuLayout.addView(button);

This is your first button. To make another one you would "clone" it with another variable name. Let's call it button2.

var button2 = new android.widget.Button(ctx); button2.setText("Button"); button2.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ //Your Code } })); menuLayout.addView(button2);

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-64315412 .

PEMapModder commented 9 years ago

Maybe you should close this issue...

AndreyNazarchuk commented 9 years ago

Lol you're everywhere

On Wednesday, December 3, 2014, PEMapModder notifications@github.com wrote:

Maybe you should close this issue...

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-65389040 .

PEMapModder commented 9 years ago

@AndreyNazarchuk I just visited your page and saw your contributions :D

AndreyNazarchuk commented 9 years ago

Can you help me again please? :) This code:

function newLevel(){ if(!ModPE.readData("test"));{ clienMessage(ChatColor.GOLD + "Lantern, " + ChatColor.WHITE = "by " + ChatColor.BLUE + "andynazay153" + ChatColor.GREEN + "Loaded Successfully!"); ModPE.saveData("test", "Test"); } } // Bottom Top North South East West Block.defineBlock(180, "Lantern", [["redstone_lamp_on", 0], ["redstone_lamp_on", 0], ["redstone_lamp_on", 0], ["redstone_lamp_on", 0], ["redstone_lamp_on", 0], ["redstone_lamp_on", 0]]); Block.setDestroyTime(180,2); Block.setShape(180,0.5,0,0.5,0.5,0.5,0.5); Block.setLightLevel(180, 16); function destroyBlock(x, y, z){ var blockId = Level.getTile(x, y, z); if(blockId == 180){ preventDefault(); Level.destroyBlock(x, y, z, true); } }

Is crashing for no reason at all, It does not even say whats wrong in the error, except: evaluator exception and stuff like that. I think it might be because of Block.setShape but I don't know Thanks :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1:

beatzunknown commented 9 years ago

if(!ModPE.readData("test"));{

What is that semicolon doing there? Tell me if it works now, I left the MCPE modding community so I don't know ModPE that well anymore.

And ChatColor.WHITE = "by" doesn't seem right.

AndreyNazarchuk commented 9 years ago

Oh lol, Idk how the ; got there, and the = was sop posed to be a +

On Saturday, December 6, 2014, BeATz-UnKNoWN notifications@github.com wrote:

if(!ModPE.readData("test"));{

What is that semicolon doing there? Tell me if it works now, I left the MCPE modding community so I don't know ModPE that well anymore.

And ChatColor.WHITE = "by" doesn't seem right.

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-65928944 .

AndreyNazarchuk commented 9 years ago

One of my mods is importing, but then crashes a few seconds after I open a world, I just added 200 lines of code, though idk why it would crash a few seconds after opening a world, I mean, it has already checked for updates and it loads the GUI when the game is still generating the world, so idk, nothing is sop posed to be proccesing at the time, and it's before the chunks generate. Do you possibly have an idea of why it is doing this injustice to me? Thanks!

On Saturday, December 6, 2014, BeATz-UnKNoWN notifications@github.com wrote:

if(!ModPE.readData("test"));{

What is that semicolon doing there? Tell me if it works now, I left the MCPE modding community so I don't know ModPE that well anymore.

And ChatColor.WHITE = "by" doesn't seem right.

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-65928944 .

AndreyNazarchuk commented 9 years ago

Heres a link:

https://www.dropbox.com/s/dtw3j6rr7g1un4c/Kits.js?dl=0

PEMapModder commented 9 years ago

@AndreyNazarchuk shoghicp did that too :D

AndreyNazarchuk commented 9 years ago

@PEMapModder did what? Asked for help?

On Sunday, December 7, 2014, PEMapModder notifications@github.com wrote:

@AndreyNazarchuk https://github.com/AndreyNazarchuk shoghicp did that too :D

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-65930630 .

AndreyNazarchuk commented 9 years ago

I'm pretty sure its something wrong with this, because when I remove this it does not crash:

if(checkForUpdate==false) { print("Checking for updates"); ctx.runOnUiThread(new java.lang.Runnable({ run: function() { try { checkVersion(); } catch(err) { clientMessage("§8[IS] Error: \n"+err); } } })); checkForUpdate=true; } if(updateWindow) { ctx.runOnUiThread(new java.lang.Runnable({ run: function() { try { updateVersion(); } catch(err) { clientMessage("§8[IS] Error: \n" + err); } } })); updateWindow=false; }

PEMapModder commented 9 years ago

@AndreyNazarchuk I meant if(boolean);{}

beatzunknown commented 9 years ago

The problem could also be in your updateVersion or checkVersion function. I don't see you crossing the Java bridge in those functions.

AndreyNazarchuk commented 9 years ago

Hmm..... But there is no update, the update file in my GitHub is the same as the version in the code

On Tuesday, December 9, 2014, BeATz-UnKNoWN notifications@github.com wrote:

The problem could also be in your updateVersion or checkVersion function. I don't see you crossing the Java bridge in those functions.

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-66248135 .

AndreyNazarchuk commented 9 years ago

Well, I had someone test it for me and it did not crash, so I think it was because my testing device is old, thanks.

On Tue, Dec 9, 2014 at 7:11 AM, Andrey Nazarchuk andynazay153@gmail.com wrote:

Hmm..... But there is no update, the update file in my GitHub is the same as the version in the code

On Tuesday, December 9, 2014, BeATz-UnKNoWN notifications@github.com wrote:

The problem could also be in your updateVersion or checkVersion function. I don't see you crossing the Java bridge in those functions.

— Reply to this email directly or view it on GitHub https://github.com/BeATz-UnKNoWN/ModPE_Scripts/issues/1#issuecomment-66248135 .