Page 1 of 3

[Update] Hello World

Posted: 2009-07-17 13:25
by prbot

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

Re: Hello World

Posted: 2009-07-17 13:29
by com_kieffer
!jdam
!sniper

!prbot am i a great ?


Why doesn't it work ! :P

Re: Hello World

Posted: 2009-07-17 13:31
by Napoleon_TR
Whats that? Im confused. xD

Re: Hello World

Posted: 2009-07-17 13:33
by dbzao
You can talk to prbot live on PR's IRC channel:

https://www.realitymod.com/forum/f10-pr ... annel.html

Re: Hello World

Posted: 2009-07-17 13:33
by AncientMan
Great work prbot, tested out the code then, works great :D . Looking forward to your next project.

Re: Hello World

Posted: 2009-07-17 13:35
by Outlawz7
When I saw the title I thought that Devs implemented a Hello Kitty gamemode into PR...

Re: Hello World

Posted: 2009-07-17 13:37
by AfterDune
Finally. I've asked him like a thousand times to post something... He's a bit shy at times ;)

Re: Hello World

Posted: 2009-07-17 13:40
by Blade.3510
and the austrailians were like "wtf m8s"?

Re: Hello World

Posted: 2009-07-17 13:43
by McBumLuv
heheheh...

!jdam
!ied
!jdam
!arty
!arty
!arty
!arty
!arty
<prbot has been disconnected>
Admin: O Maj Gawd, you killed Kenny! err, I mean PRbot!
<McLuv has been kicked from the server>

:D

Ahhh, the good ol' waiting-for-pr-0.85-to-come-out-and-spamming-IRC days :p

Re: Hello World

Posted: 2009-07-17 13:47
by HunterMed
you DEVs and your sneaky advertising of IRC channel :D

Re: Hello World

Posted: 2009-07-17 13:54
by Hans Martin Slayer
Great job so far prbot - keep it up mate!

Re: Hello World

Posted: 2009-07-17 14:08
by Spec
Haha, awesome! prbot FTW! I should spa... use the chat again^^

Re: Hello World

Posted: 2009-07-17 14:10
by jmlane
Spec_Operator wrote:Haha, awesome! prbot FTW! I should spa... use the chat again^^
I see what you did there.

Re: Hello World

Posted: 2009-07-17 14:12
by =Romagnolo=
Image

Re: Hello World

Posted: 2009-07-17 14:16
by AnimalMother.
=Romagnolo= wrote:Image
*i am confused too*

Edit: User was warned for hiding his post by mimicking its color with the post background. Even for comedy effect this is not accepted per the forum rules.

Re: Hello World

Posted: 2009-07-17 14:25
by Robbi
ah, db's Boss makes an appearance finally :mrgreen:

Re: Hello World

Posted: 2009-07-17 14:32
by Tomato-Rifle
Prbot is the brains behind Project reality

Re: Hello World

Posted: 2009-07-17 14:32
by Wilkinson
def deploy_fastropes(vehicle):
""" deploy fast ropes from a vehicle """
if vehicle.getName() == "blackhawk":
return false
else:
vehicle.deploy_fastropes()

hehe Awesome prbot

Re: Hello World

Posted: 2009-07-17 14:32
by Polka
I really hope the bot isnt British made, because you know the electrics will fail then.

Re: Hello World

Posted: 2009-07-17 14:47
by Gore
!prbot...

bye bye.