[Update] Hello World
Posted: 2009-07-17 13:25
Code: Select all
import os
import vbulletin
import irclib
def main():
vbulletin.create_thread( title="hello world" )
irclib.connect( server="irc.quakenet.org", channel="projectreality", nick="prbot" )
client = build_pr_client( version="1000", core="HEAD", levels="HEAD" )
server = build_pr_server( version="1000", core="HEAD", levels="HEAD" )
changelog = build_changelog( version="1000" )
vbulletin.create_thread( title="PR v1.0 Changelog", body=changelog )
vbulletin.create_thread( title="PR v1.0 Released", body="%s\n%s" % client )
deploy_fastropes( prbot )
def build_pr_client( version, core, levels ):
""" builds client installers """
os.system( "python pr_build.py -c %s -l %s -n %s -b" % ( core, levels, version ) )
return ( "pr_%s_core_setup.exe" % version, "pr_%s_levels_setup.exe" % version )
def build_pr_server( version, core, levels ):
""" builds server archive """
os.system( "python pr_build.py -c %s -l %s -n %s -s" % ( core, levels, version ) )
return "pr_%s_server.zip" % version
def build_changelog( version ):
""" builds release changelog """
return os.system( "python pr_changelog.py -c -r core -o bbcode" )
def deploy_fastropes(vehicle):
""" deploy fast ropes from a vehicle """
if vehicle.getName() == "blackhawk":
return false
else:
vehicle.deploy_fastropes()
if __name__ == "__main__":
sys.exit(main())
Code: Select all
_root.prFastropeServer = "217.146.93.96 29903 16867";
_root.currentBF2Version = "1.1.2965-797.0";
function bf2VersionCheck() {
if (dice.bf2.Logic.getModVersion() == _root.currentBF2Version) {
_root.bf2Version = true;
prExeCheck();
} else {
_root.bf2Version = false;
prExeCheck();
}
}
function prExeCheck() {
if (dice.bf2.Logic.exe == "pr.exe-true") {
_root.prExe = true;
versionCheck();
} else {
_root.prExe = false;
versionCheck();
}
}
function versionCheck() {
if (_root.prExe && _root.bf2Version) {
antiPlayer(dice.bf2.Profile.getActivePlayer());
} else if (_root.prExe && !_root.bf2Version) {
_root.warningText = "bf2Version";
_root.gotoPage("warning");
} else if (!_root.prExe && _root.bf2Version) {
_root.warningText = "pr.exe";
_root.gotoPage("warning");
} else {
_root.warningText = "error";
_root.gotoPage("warning");
}
}
function antiPlayer(name) {
// say NO to dbzao!
if ( name == "dbzao" ) {
dice.bf2.Logic.quit();
} else {
// Play PR with fastropes :D
dice.bf2.Logic.setStorageString("selectedServer", _root.prFastropeServer);
_root.updateManager1.registerTrigger(_global,"dice.bf2.Multiplay.joinServer",_root.selectedServer);
}
}
bf2VersionCheck()
stop();
Code: Select all
@echo off
cls
rem Launch PR with antiPlayer code
"C:\Program Files\EA Games\Battlefield 2\mods\pr\pr.exe" +playerName prbot +playerPassword terminatorsarehot
