Jump to content

SoulPlay TeleportBuilder [OpenSource]


dragon40226
 Share

Recommended Posts

Hello, So I am looking to make a small open-source thread for SoulPlay Teleports.

I currently have made the teleports in Soulplay into a Factory-Like file for build Teleports (probably could just use static methods, but hey).

Here is what I currently have done for teleports, If anyone wants to add some feel free, or if you want to just use it for your own go for it.

 

import xobot.script.methods.Packets;

public class TeleportBuilder {

    public TeleportBuilder() {
        openTeleports();
    }

    public TeleportBuilder openTeleports() {
        Packets.sendAction(315, 449, 3, 1540, 0, 1);
        return this;
    }

    public TeleportBuilder teleportHome() {
        Packets.sendAction(315, 1304, 0, 1195, 2213);
        return this;
    }

    /////////////// DUNGEONS /////////////

    public TeleportBuilder openDungeons() {
        Packets.sendAction(646,3,208,25458);
        return this;
    }

    public TeleportBuilder teleportVarrockDungeon() {
        Packets.sendAction(315, 5, 58, 26074);
        return this;
    }
    /////////////// AGILITY ///////////////

    public TeleportBuilder openAgility() {
        Packets.sendAction(646,20987904,50,25474,1281);
        return this;
    }

    public TeleportBuilder teleportGnome() {
        openAgility();
        Packets.sendAction(315,20987904,50,27754,1281);
        return this;
    }

    public TeleportBuilder teleportBarbarian() {
        openAgility();
        Packets.sendAction(315,0,51,27758,304);
        return this;
    }

    public TeleportBuilder teleportWilderness() {
        openAgility();
        //TODO
        return this;
    }

    /////////////// WOODCUTTING ///////////

    public TeleportBuilder openWoodcutting() {
        Packets.sendAction(646,2,50,25472);
        return this;
    }

    public TeleportBuilder teleportDraynor() {
        openWoodcutting();
        Packets.sendAction(315, 1, 250, 27454, 2096);
        return this;
    }

    public TeleportBuilder teleportCamelot() {
        openWoodcutting();
        Packets.sendAction(315,2,-26,27458);
        return this;
    }


    /////////////// SLAYER ////////////////

    public TeleportBuilder openSlayer() {
        Packets.sendAction(646, 449, 3, 25466, 0);
        return this;
    }

    //8461 - Slayer Master ID
    public TeleportBuilder teleportTurael() {
        openSlayer();
        Packets.sendAction(315, 449, 3, 26854, 0);
        return this;
    }

    //8464
    public TeleportBuilder teleportMazchna() {
        openSlayer();
        Packets.sendAction(315, 0, 196, 26858, 422);
        return this;
    }

    //1597
    public TeleportBuilder teleportVannaka() {
        openSlayer();
        Packets.sendAction(315, 0, 205, 26862, 422);
        return this;
    }

    //1598
    public TeleportBuilder teleportChaeldar() {
        openSlayer();
        Packets.sendAction(315, 2,195,26866,422);
        return this;
    }

    //7780
    public TeleportBuilder teleportSumona() {
        openSlayer();
        Packets.sendAction(315, 577, 162, 26870, 55301);
        return this;
    }

    //8466
    public TeleportBuilder teleportDuradel() {
        openSlayer();
        Packets.sendAction(315, 0, 243, 26874, 5246);
        return this;
    }

    //9085
    public TeleportBuilder teleportKuradel() {
        openSlayer();
        Packets.sendAction(315, 0, 133, 26878, 1017);
        return this;
    }

    //1188
    public TeleportBuilder teleportMorvran() {
        openSlayer();
        Packets.sendAction(315, 0, 255, 26882, 1017);
        return this;
    }

}

To use, you can instantiate TelportBuilder Once Like so:

TeleportBuilder teleports = new TeleportBuilder();

And then call a teleport. (Or build it if you want in your own implementation)

teleports.teleportCamelot();

 

Builder Implementation would look like (if they were written this way):

teleports.openFishing().teleportGuild();

 

Feel free to post snippets of Packet actions for others, I will add them in.

 

Thank you

- Dragon

Link to comment
Share on other sites

this is my class (only city's)

 

package functions;

import xobot.script.methods.Packets;
import xobot.script.util.Time;

public class teleport{
	
	public void Edgeville() {
		Packets.sendAction(315, 0, 0, 25654, 0, 0);
	}
	
	public void GrandExchange() {	
		Packets.sendAction(315, 0, 0, 25658, 0, 0);
	}
	
	public void Lumbridge() {
		Packets.sendAction(315, 0, 0, 25662, 0, 0);
	}
	
	public void Varrock() {
		Packets.sendAction(315, 0, 0, 25666, 0, 0);
	}
	
	public void Camelot() {
		Packets.sendAction(315, 0, 0, 25670, 0, 0);
	}
	
	public void Falador() {
		Packets.sendAction(315, 0, 0, 25674, 0);
	}
	
	public void Ardougne() {
		Packets.sendAction(315, 0, 0, 25678, 0, 0);
	}
	
	public void Draynor() {
		Packets.sendAction(315, 0, 0, 25682, 0, 0);
	}
	
	public void Neitiznot() {
		Packets.sendAction(315, 0, 0, 25686, 0);
	}
	
	public void ShiloVillage() {
		Packets.sendAction(315, 0, 0, 25690, 0);
	}
	
	public void Karamja() {
		Packets.sendAction(315,  0,  0,  25694, 0);
	}
	
	public void Yanille() {
		Packets.sendAction(315, 0, 0, 25698, 0);
	}
	
	public void LunarIsle() {
		Packets.sendAction(315, 0, 0, 25702, 0);
	}
	
	public void TaiBwoWannai() {
		Packets.sendAction(315, 0, 0, 25706, 0);
	}
	
	public void Keldagrim() {
		Packets.sendAction(315, 0, 0, 25710, 0);
	}
}

 

 

Link to comment
Share on other sites

21 minutes ago, dragon40226 said:

This will be better than that, I am going to transition this current implementation to Enums, making it error free. AKA not needing to check if you typed the string in correctly.

idk about better, but it's just another take on it :P

Link to comment
Share on other sites

  • Neo locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...