Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - cooliojazz

Pages: 1 ... 4 5 [6] 7 8 ... 41
76
Minecraft Discussion / Re: List of Minecraft servers
« on: August 25, 2012, 03:26:02 pm »
Welcome to the world of non-static IPs! =P There's things like http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html that could help and give you a free domain name that will change with your ip.

77
Minecraft Discussion / Your Bukkit Mods!
« on: August 25, 2012, 01:56:34 pm »
Who else writes Bukkit mods? Post about them here!

I wrote Nomcraft!  It is an extremely extensive mod doing things like multi-type multi-worlds, irc connection, pm system, guilds, warps, map rendering (with normal and cave modes), etc etc.  I can't even list all the exact features cause I'm still to lazy to actually go through and write them all down XD  If you want, you can browse the source in the svn to try to get an idea of everything, or download it and try it out! =D

78
That it would be the best thing since literally sliced bread.  I don't really think it would be that hard, you just have to tell everyone maybe a couple months ahead, and then whoever can do it, can do it!  And if you can't, we can turn it into a biannual thing so there'll always be another one! (If you miss it, I mean)

79
Minecraft Discussion / Re: List of Minecraft servers
« on: August 23, 2012, 11:07:34 am »
Juju, you should take my server off of that list, because at least for now, my minecraft server (the entire server for that matter) is going down.  Maybe forever, we'll just have to see how UP turns out =P

80
Computer Projects and Ideas / Re: Random Java Libs
« on: August 05, 2012, 09:58:00 pm »
In light of the contest, I figured I might post all the amazing updates I've made to JIRC if anyone wants to use java and make their life easy ;D

Updated example:
Code: [Select]
import com.up.jirc.*;
import java.io.*;
import java.text.DateFormat;
import java.util.*;
import java.util.regex.*;

public class Test {
   
    static PrintStream sout = System.out;
    static BufferedReader sin = new BufferedReader(new InputStreamReader(System.in));
    static String ActiveIRCChannel = "";
   
    public static void main(String args[]) {
        JIRC omni = new JIRC("withg.us.to", "JIRC_Test", "Test Implementation of JIRC", 6667) {
            protected void onConnect() {
                sout.println("Connected!");
            }

            protected void onPingged(String server) {
                sout.println("Ping? Pong!");
            }

            protected void onServerMessage(String message) {
                try {
                    ServerResponse sr = ServerResponse.parseString(message);
                    switch (sr.numeric) {
                        case MOTD:
                            sout.println("MOTD " + sr.response);
                            break;
                        case MOTDSTART:
                            sout.println("Message of the Day, " + sr.server);
                            break;
                        case ENDOFMOTD:
                            sout.println("End of MOTD");
                            break;
                        default:
                            sout.println(sr.numeric.toString() + ": " + sr.response);
                            break;
                    }
                } catch (Exception e) {
                    sout.println("[" + DateFormat.getTimeInstance(DateFormat.SHORT).format(new Date()) + "] - " + message);
                }
            }

            protected void onChannelMessageReceive(String channel, String nick, String message) {
                sout.println("[" + DateFormat.getTimeInstance(DateFormat.SHORT).format(new Date()) + "] #" + channel + ": <" + nick + "> " + message);
            }

            protected void onPrivateMessageReceive(String nick, String message) {
                sout.println("[" + DateFormat.getTimeInstance(DateFormat.SHORT).format(new Date()) + "] <" + nick + "> " + message);
            }

            protected void onChannelMemberPart(String channel, String nick) {
                sout.println(channel + ": " + nick + " has left");
            }

            protected void onChannelMemberJoin(String channel, String nick) {
                sout.println(channel + ": " + nick + " has joined");
            }

            protected void onChannelMemberQuit(String nick, String message) {
                sout.println(nick + " has quit (" + message + ")");
            }
        };
        omni.setAddColors(true);
//        BLACKF "\033[30m"
//        GREYF "\033[1;30m"
//        REDF "\033[31m"
//        LIGHTREDF "\033[1;31m"
//        GREENF "\033[32m"
//        LIGHTGREENF "\033[1;32m"
//        YELLOWF "\033[33m"
//        LIGHTYELLOWF "\033[1;33m"
//        BLUEF "\033[34m"
//        LIGHTBLUEF "\033[1;34m"
//        MAGENTAF "\033[35m"
//        LIGHTMAGENTAF "\033[1;35m"
//        CYANF "\033[36m"
//        LIGHTCYANF "\033[1;36m"
//        WHITEF "\033[37m"
//        LIGHTWHITEF "\033[1;37m"
//        RESET "\033[0m"
        omni.setColors(new String[] {"\033[37m", "\033[30m", "\033[34m", "\033[32m", "\033[1;31m", "\033[31m", "\033[35m", "\033[1;31m", "\033[1;33m", "\033[1;32m", "\033[36m", "\033[1;36m", "\033[1;34m", "\033[1;35m", "\033[1;30m", "\033[1;30m", "\033[0m"});
        omni.start();
Pattern JoinCommand = Pattern.compile("/(?:join|j) (.+)", Pattern.CASE_INSENSITIVE);
Pattern PartCommand = Pattern.compile("/(?:part|p)", Pattern.CASE_INSENSITIVE);
Pattern CACCommand = Pattern.compile("/cac (.+)", Pattern.CASE_INSENSITIVE);
Pattern NickCommand = Pattern.compile("/(?:nick|n) (.+)", Pattern.CASE_INSENSITIVE);
Pattern OpCommand = Pattern.compile("/op (.+)", Pattern.CASE_INSENSITIVE);
Pattern DeOpCommand = Pattern.compile("/deop (.+)", Pattern.CASE_INSENSITIVE);
Pattern RawCommand = Pattern.compile("/raw (.+)", Pattern.CASE_INSENSITIVE);
Pattern ListCommand = Pattern.compile("/(?:list|l) #(.+)", Pattern.CASE_INSENSITIVE);
Pattern ExitCommand = Pattern.compile("/(?:exit|e)", Pattern.CASE_INSENSITIVE);
        try {
            while (true) {
                while (sin.ready()) {
                    String msg = sin.readLine();
                    if (msg != null) {
                        Matcher m;
                        if ((m = JoinCommand.matcher(msg)).find(0)) {
                            omni.joinChannel(m.group(1).replace("#", ""));
                        } else if ((m = PartCommand.matcher(msg)).find(0)) {
                            omni.partChannel(ActiveIRCChannel);
                        } else if ((m = NickCommand.matcher(msg)).find(0)) {
                            omni.changeNick(m.group(1));
                        } else if ((m = OpCommand.matcher(msg)).find(0)) {
                            omni.opChannelMember(ActiveIRCChannel, m.group(1));
                        } else if ((m = DeOpCommand.matcher(msg)).find(0)) {
                            omni.deOpChannelMember(ActiveIRCChannel, m.group(1));
                        } else if ((m = CACCommand.matcher(msg)).find(0)) {
                            ActiveIRCChannel = m.group(1).replace("#", "");
                            sout.println("Changed the active channel to " + ActiveIRCChannel);
                        } else if ((m = ListCommand.matcher(msg)).find(0)) {
                            Channel curchan = omni.getChannelList().get(JIRC.inChannelList(omni.getChannelList(), m.group(1)));
                            Person[] People = curchan.getAllMembers();
                            for (int x = 0; x < People.length; x++) {
                                sout.println(People[x].getName() + " (" + People[x].getModes() + ") Active: " + People[x].isActive());
                            }
                        } else if ((m = RawCommand.matcher(msg)).find(0)) {
                            omni.sendRawMessage(m.group(1));
                        } else if ((m = ExitCommand.matcher(msg)).find(0)) {
                            sout.close();
                            sin.close();
                            System.exit(0);
                        } else if (msg.startsWith("/")) {

                        } else {
                            omni.sendMessage(ActiveIRCChannel, msg);
                            sout.println("#" + ActiveIRCChannel + ": <" + omni.getNick() + "> " + msg);
                        }
                    }
                }
                Thread.sleep(10);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


Major things:
-Package change, now is com.up.jirc instead of just jirc
-Color support
-Server response parsing.  Does not include every single IRC response numeric, or even most of them, but it does have most of the more common ones, I probably will add the rest eventually =P
-And then just fixing a lot of stupid various connection things
-Also, the constructor now requires the port to connect to

I dislike how much time I spent javadoc-ing though...  And I still left a lot un-done! D= That's why I like personal projects, documentation is for losers ;P

81
Computer Programming / Re: Gif to pixel data help
« on: August 04, 2012, 02:36:30 pm »
http://www.daniweb.com/software-development/java/threads/177666/imageobserver-and-animated-gifs#post811177 Is where I found the code I used in the first part to actually load the frame data, then I saw a mention of metadata somewhere, so I googled that and came up with http://docs.oracle.com/javase/1.4.2/docs/api/javax/imageio/metadata/package-summary.html and therefore http://docs.oracle.com/javase/1.4.2/docs/api/javax/imageio/metadata/doc-files/gif_metadata.html which I used to write the metadata extractor, then I just added a simple animator to use all the read data.

82
Computer Programming / Re: Gif to pixel data help
« on: August 04, 2012, 01:33:02 pm »
Okay, here's an example I made that shows loading a gif and displaying it as an animation.  You should be able to look at this and adapt it for what you need.  If you need help, just ask, or if you want me to try and adapt it for you, I could try, you'll just need to provide a little more info on the code structure of the project =P

Code: [Select]
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Iterator;
import javax.imageio.*;
import javax.imageio.metadata.*;
import javax.imageio.stream.*;
import org.w3c.dom.*;

public class GIFTEST {
    public static void main(String[] args) throws IOException {
        File input = new File("cat.gif");
        ImageInputStream stream = ImageIO.createImageInputStream(input);
        Iterator readers = ImageIO.getImageReaders(stream);
        if (!readers.hasNext()) throw new RuntimeException("No image reader found");
        ImageReader reader = (ImageReader)readers.next();
        reader.setInput(stream);
        int num = reader.getNumImages(true);
        GifFrame[] frames = new GifFrame[num];
        for (int i = 0; i < num; i++) {
            frames[i] = new GifFrame();
            BufferedImage image = reader.read(i);
            frames[i].i = image;
            IIOMetadata meta = reader.getImageMetadata(i);
            NodeList nodes = meta.getAsTree(meta.getNativeMetadataFormatName()).getChildNodes();
            for (int x = 0; x < nodes.getLength(); x++) {
                Node n = nodes.item(x);
                if (n.getLocalName().equals("GraphicControlExtension")) {
                    NamedNodeMap atts = n.getAttributes();
                    frames[i].time = Integer.parseInt(atts.getNamedItem("delayTime").getNodeValue());
                    frames[i].dispose = atts.getNamedItem("disposalMethod").getNodeValue();
                    frames[i].wait = Boolean.parseBoolean(atts.getNamedItem("userInputFlag").getNodeValue());
                }
            }
        }
        stream.close();
       
        Frame f = new Frame("GIF Test");
        GifAnimator ga = new GifAnimator(frames);
        ga.setSize(400, 400);
        f.add(ga);
        f.pack();
        f.setVisible(true);
        ga.start();
    }
}

class GifFrame {
    public Image i;
    public int time;
    public String dispose;
    public boolean wait;
}

class GifAnimator extends Canvas {
    private GifFrame[] frames;
    private Thread animator;
    private boolean run = false;
    private int f = 0;
   
    public GifAnimator(GifFrame[] frames) {
        this.frames = frames;
    }
   
    public void start() {
        run = true;
        animator = new Thread() {

            @Override
            public void run() {
                while (run) {
                    for (int i = 0; i < frames.length; i++) {
                        f = i;
                        repaint();
                        try {sleep(frames[i].time * 10);} catch (Exception e) {}
                    }
                }
            }
           
        };
        animator.start();
    }
   
    public void stop() {
        run = false;
    }
   
    @Override
    public void paint(Graphics g) {
        g.drawImage(frames[f].i, 0, 0, null);
    }
   
    @Override
    public void update(Graphics g) {
        paint(g);
    }
}

83
It's too bad about this, I know how you feel, with TFE and all.  This was coming along pretty well too =(  Hope your game comes out awesome now that you're fully devoted to it though ;D

84
TI Z80 / Re: [Contest] ZAMPO
« on: July 08, 2012, 08:28:07 pm »
It's about 80% unit calculations I'd guess.  The mapper/drawing stuff is pretty fast, although i'm sure it could be a bit faster too.

85
TI Z80 / Re: [Contest] ZAMPO
« on: July 08, 2012, 05:27:57 pm »
So now that the contest is over anyone who wants to try to optimize things enough so you can actually have 50 units on the screen without it dropping to 1-2fps, I would love you forever.  I am going to finish this soon, but I'm taking a break, then the fps is probably the biggest thing right now, most of the other stuff is adding data, or changing it.

86
News / Re: Contest ends in 10 minutes!
« on: July 08, 2012, 12:55:37 am »
Wut? O_o The info page says GMT-5 1:00, and its just about 12 GMT-5...

87
TI Z80 / Re: [Contest] ZAMPO
« on: July 06, 2012, 01:26:06 pm »
Thanks guys! =D
It does similar, as much as all RTSes look fairly similar =P  Game elements, I guess there's the 3 building which I mentioned in the previous post, (Viec, Darf, Yarl), a few types of zombies (harvester, melee, ranged?, ...), and I haven't really decided on the data for the enemies yet as I've been focusing on finishing the engine, but probably marine type units or something, there will be a couple types of those too.  Anything else you're looking for in terms of elements? =P
EDIT: Also, if you guys were wondering, the number left corner is the approximate FPS

88
TI Z80 / Re: [Contest] ZAMPO
« on: July 05, 2012, 10:26:54 pm »
Way later than I wanted, but a couple screenshots. These showcase the viec, which auto-spawns units as you have the bodies (its a harvester viec), harvesters, which are collecting the dead, and a plain zombie, which is attacking the harvesters (Just for testing, obviously not what really happens =P), and a couple other things such as auto-targeting, target lines, etc.  It'll be close, and definitely not the full version that I envision, but we'll see if i can get a good enough version for the contest.

89
TI Z80 / Re: [Contest] ZAMPO
« on: July 02, 2012, 02:18:05 pm »
Steps to creating a zombie army:
1. Equip zombies with buckets.
2. Tell the zombies to find dead bodies lying around and bring them back to your Darf (Dead Acceptance and Repair Facility).
3. Send those dead bodies to the nearest Viec (Virus Induction and Equipment Center) to get some feisty attack zombies.
4. ? ? ?
5. Profit.
6. (Optional step) Abuse some of those extra bodies not yet turned zombie in the Yarl (Yarlton's Awesome Research Lab) to make your zombies even better at turning the rest of the world like them.

There's another little something =P I've really been wanting to post a screenshot, but I want to get a certain thing working correctly first before I do, haha.

90
TI Z80 / Re: [Contest] ZAMPO
« on: June 27, 2012, 01:59:15 pm »
Haha, yeah, I haven't been working on a lot of cal stuff lately, probably the most TI thing I've been working on before this is TFE =P  And yeah, I totally thought of that title, and I'm like, "OMG, that would be perfect for a game name! Now how the hell  would a game with a title like that be?" =P So then I wrote that storyline to fit.  And the one thing I will say now before I finish up everything for a real post about the game is that it's a sort of RTS where, as you can probably gather, you play as the zombies taking over the world.

Pages: 1 ... 4 5 [6] 7 8 ... 41