[Release] Sexbot

Status
Not open for further replies.
Dzit, get rid of the comma (,) at the end of the public void execute... line.

ty sathon now 1 last error and idk how to fix it as i said to many people i am just learning java so bare with me here :D

ok here is my command file that has been updated

Code:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <[email protected]>
                       Matthias Butz <[email protected]>
                       Jan Christian Meyer <[email protected]>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


package net.sf.odinms.client.messages.commands;


import net.sf.odinms.client.sexbot.SexBot;


public class customCommands implements Command {


	@Override
	public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception

 if(splitted[0].equals("!sexbot"))
            {
                if(splitted[1].equals("spawn"))
                {
                    boolean spawned = false;
                    SexBot sb;
                    
                    int charid = (int) Integer.parseInt(splitted[2]);

                    Collection<ChannelServer> cservsC = ChannelServer.getAllInstances();
                    ChannelServer cservs[] = cservsC.toArray(new ChannelServer[cservsC.size()]);

                    for(int i = 0; i < cservs.length; i++)
                    {
                        if(cservs[i].getSexBot() != null)
                        {
                            spawned = true;
                            sb = cservs[i].getSexBot();
                            mc.dropMessage("Sexbot is already spawned in channel " + sb.getClient().getChannel() + " on map " + sb.getMap());
                        }
                    }

                    if(!spawned)
                    {
                        sb = new SexBot();
                        c.getChannelServer().setSexBot(sb);
                        sb.spawnSexBot(c.getPlayer().getMap(), c.getPlayer().getPosition(), charid);

                        mc.dropMessage("Spawned Sexbot in channel " + sb.getClient().getChannel() + " on map " + sb.getMap());
                    }
                }

                else if(splitted[1].equals("stance"))
                {
                    int stance = (int) Integer.parseInt(splitted[2]);
                    SexBot sb = c.getChannelServer().getSexBot();

                    sb.getCharacter().setStance(stance);

                    MaplePacket packet = MaplePacketCreator.updateCharLook(sb.getCharacter());
                    c.getPlayer().getMap().broadcastMessage(sb.getCharacter(), packet, false);
                }
            }

}

k now here is the error i recive

Code:
init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\Patrick\Desktop\OdinMS\build\classes
C:\Documents and Settings\Patrick\Desktop\ChowderMS\trunk\src\net\sf\odinms\client\messages\commands\sexbot.java:33: ';' expected
        public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception
                                                                                                  ^
1 error
BUILD FAILED (total time: 2 seconds)

if you know how to fix it please exsplain for me so i know for future time when i make commands

If possiable if someone could just make me the command file and let me look over it so i see how u did it that would be better

thanks
 
Last edited:
Well I did what Sathon advised Dzit to do, plus, I took out throws exception and I ended up with these 2 errors o-o....(i'm using FusionMs rev44, v.60 ms) help please D: I was able to fix like....5 errors but now im stuck :/
init:
deps-jar:
Compiling 5 source files to C:\Documents and Settings\Bryant\Desktop\Rev44\build\classes
C:\Documents and Settings\Bryant\Desktop\Rev44\src\net\sf\odinms\client\messages\commands\sexbot.java:33: ';' expected
public void execute(MapleClient c, MessageCallback mc, String[] splitted)
C:\Documents and Settings\Bryant\Desktop\Rev44\src\net\sf\odinms\net\channel\handler\MovePlayerHandler.java:88: ')' expected
}, 500);
2 errors
BUILD FAILED (total time: 0 seconds)
 
And sathon i figured out how to spawn more than one sexbot XD..
I think it worked.. Didnt actually test it.
Its in the command !sexbot spawn right?

Just remove the check in the !spawn command.

You shouldn't do this though. There is code that checks for which Sexbot is registered with the server, so if you try to spawn more than one (the way it's coded right now), then only 1 will actually work (the last one you spawned). The other ones will just sit there and not do anything.

You can fix this by making the ChannelServer hold an array of Sexbots and have the code I'm talking about (I believe the chat and the following code are the only 2) cycle through the array.
 
Any ideas about my problem Sathon? D: I've been trying to figure out by looking into MaplePacket.java but I can't find the source of the problem ><
 
i can't see my sexbot
it give me message SexBot is already spawend chanel 1 on map 100000000
but i can't see him

You didn't spawn it properly. You probably entered the wrong character ID. Reatart the server and try again, and make sure you're doing it properly.
 
Thanks. I'll try. Btw, even if the sexbot is in Gm Map, you can still talk to it even if your in FM.

Ah, you're right. I seem to have forgotten to add a map check in the chat handler.

Good job for noticing that, you get a cookie.
 
Status
Not open for further replies.
Back