Official Nerd Herd Coding Thread
Nerdie Birdie
23514 cr points
Send Message: Send PM GB Post
19 / M / Norway
Offline
Posted 7/24/12
Welcome to my "Official" Nerd Herd Coding thread. Talk about anything related to coding. YEEEEY!

Just for funzeez :D

<?php

$cupofcare = "";

if(empty($cupofcare)) {
echo 'This is my cup of care its empty.';
} else {
echo 'This is my cup of care its full..... Damn..';
}

?>
Nerdie Birdie
23514 cr points
Send Message: Send PM GB Post
19 / M / Norway
Offline
Posted 7/24/12 , edited 7/24/12
PHP Simple Password protected page.


<?php
if(isset($_POST['login'])) { // Here it checks if the form is set.
if(empty($_POST['password'])) { // Here it checks if the textbox is empty when you click login.
echo 'Type in a password';
} elseif($_POST['password'] !== "secretpassword") { // Here it checks if the password is not "secretpassword" then do something.
echo 'wrong password';
} elseif($_POST['password'] == "secretpassword") { // Here it checks if the password is "secretpassword" then do something.
echo 'Welcome';
}
} else {
?>
<form action="" method="POST">
<input type="password" name="password" />
<input type="submit" name="login" value="Login" />
</form>

<?php
}
?>
Nerdie Birdie
23514 cr points
Send Message: Send PM GB Post
19 / M / Norway
Offline
Posted 8/5/12
Batch file (.bat)

@echo off
:starter
start =notepad.exe
goto starter
Nerdie Birdie
23514 cr points
Send Message: Send PM GB Post
19 / M / Norway
Offline
Posted 8/7/12 , edited 8/7/12
Im seriously bored. Just posting random basic crap xD
Java:

package HelloWorld;

public class Hello {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
Nerdie Birdie
23514 cr points
Send Message: Send PM GB Post
19 / M / Norway
Offline
Posted 8/7/12 , edited 8/7/12
Rather less basic. If you try to use this it probably wont work you need to have a external jar craftbukkit. In eclipse

package me.leafburner.Gisse;

import java.util.logging.Logger;



import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

public class Gisse extends JavaPlugin {
public static Gisse plugin;
public final Logger logger = Logger.getLogger("Minecraft");

public void onEnable(){
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + " is now enabled.");
}

public void onDisable(){
PluginDescriptionFile pdfFile = this.getDescription();
this.logger.info(pdfFile.getName() + " is now disabled.");
}
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
World world = player.getWorld();
if(commandLabel.equalsIgnoreCase("gisseattack")) {
if(args.length == 0) {
Player targetplayer = player.getServer().getPlayer(args[0]);
Block targetblock = player.getTargetBlock(null, 10);
Location location = targetblock.getLocation();
world.strikeLightning(location);
world.createExplosion(location, 20);
getServer().broadcastMessage(ChatColor.RED + "Oh shit " + targetplayer.getDisplayName() + " is angry.......");
} else if (args.length == 1) {
if(player.getServer().getPlayer(args[0]) !=null) {
Player targetplayer = player.getServer().getPlayer(args[0]);
Location location = targetplayer.getLocation();
world.strikeLightning(location);
player.sendMessage(ChatColor.GREEN + "GisseAttack on player " + targetplayer.getDisplayName());
getServer().broadcastMessage(ChatColor.RED + "Oh shit Gisse is hissi on " + targetplayer.getDisplayName());
} else {
Player targetplayer = player.getServer().getPlayer(args[0]);
player.sendMessage(ChatColor.RED + "The player is not online." + targetplayer.getDisplayName());
}
} else if (args.length > 1) {
player.sendMessage(ChatColor.RED + "Too many arguments>!");
}
}
return false;
}

}
You must be logged in to post.