[Update] Hello World

prbot
PR:BF2 Lead Developer
Posts: 16020
Joined: 2009-07-17 11:51

[Update] Hello World

Post 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
Last edited by AncientMan on 2009-07-17 15:31, edited 2 times in total.
com_kieffer
Posts: 180
Joined: 2007-04-02 15:51

Re: Hello World

Post by com_kieffer »

!jdam
!sniper

!prbot am i a great ?


Why doesn't it work ! :P
Napoleon_TR
Posts: 303
Joined: 2008-03-18 13:10

Re: Hello World

Post by Napoleon_TR »

Whats that? Im confused. xD
dbzao
Retired PR Developer
Posts: 9381
Joined: 2006-06-08 19:13

Re: Hello World

Post by dbzao »

You can talk to prbot live on PR's IRC channel:

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

"There's always one more bug." - Lubarsky's Law of Cybernetic Entomology
AncientMan
Retired PR Developer
Posts: 5111
Joined: 2007-05-22 07:42

Re: Hello World

Post by AncientMan »

Great work prbot, tested out the code then, works great :D . Looking forward to your next project.
Image
Outlawz7
Retired PR Developer
Posts: 17261
Joined: 2007-02-17 14:59

Re: Hello World

Post by Outlawz7 »

When I saw the title I thought that Devs implemented a Hello Kitty gamemode into PR...
Image
AfterDune
Retired PR Developer
Posts: 17094
Joined: 2007-02-08 07:19

Re: Hello World

Post by AfterDune »

Finally. I've asked him like a thousand times to post something... He's a bit shy at times ;)
Image
Blade.3510
Posts: 152
Joined: 2009-03-07 15:22

Re: Hello World

Post by Blade.3510 »

and the austrailians were like "wtf m8s"?
McBumLuv
Posts: 3563
Joined: 2008-08-31 02:48

Re: Hello World

Post 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
Image

Image

Image
HunterMed
Posts: 2080
Joined: 2007-04-08 17:28

Re: Hello World

Post by HunterMed »

you DEVs and your sneaky advertising of IRC channel :D
Hans Martin Slayer
Retired PR Developer
Posts: 4090
Joined: 2007-01-21 02:20

Re: Hello World

Post by Hans Martin Slayer »

Great job so far prbot - keep it up mate!
Spec
Retired PR Developer
Posts: 8439
Joined: 2007-09-01 22:42

Re: Hello World

Post by Spec »

Haha, awesome! prbot FTW! I should spa... use the chat again^^
jmlane
Posts: 32
Joined: 2009-05-16 12:17

Re: Hello World

Post by jmlane »

Spec_Operator wrote:Haha, awesome! prbot FTW! I should spa... use the chat again^^
I see what you did there.
Image
Image
=Romagnolo=
Posts: 4765
Joined: 2006-12-29 14:52

Re: Hello World

Post by =Romagnolo= »

Image
[R-DEV]OkitaMakoto:"Cheers, you're the man, Okita"
[R-DEV]Rhino:"I in fact got kicked from a server for tking."
Hitperson:"well done, treasure it forever."
[R-DEV]Adriaan:"Damned classy Roma, if I may say so."
[R-DEV]Chuc:"Pro man, pro."
(yes, it was about me)
[R-MOD]BloodBane611:"Romagnolo, you definitely deserve a LOL award for that."
AnimalMother.
Posts: 2476
Joined: 2007-02-25 15:38

Re: Hello World

Post 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.
Last edited by Saobh on 2009-07-17 14:58, edited 2 times in total.
ex |TG-31st|
AnimalMotherUK - YouTube

vistamaster01: "I just dont get people with girl usernames/pics/sigs lol,
for example I thought AnimalMother was a girl :o ops:"

Arte et Marte
Robbi
Posts: 3564
Joined: 2008-07-05 14:53

Re: Hello World

Post by Robbi »

ah, db's Boss makes an appearance finally :mrgreen:
Image
Image
Tomato-Rifle
Posts: 2091
Joined: 2007-12-31 22:24

Re: Hello World

Post by Tomato-Rifle »

Prbot is the brains behind Project reality
Image
Wilkinson
Posts: 1916
Joined: 2008-08-18 21:55

Re: Hello World

Post 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
Polka
Posts: 6245
Joined: 2007-07-08 14:18

Re: Hello World

Post by Polka »

I really hope the bot isnt British made, because you know the electrics will fail then.
Image
Gore
Retired PR Developer
Posts: 2491
Joined: 2008-02-15 21:39

Re: Hello World

Post by Gore »

!prbot...

bye bye.
Locked

Return to “2009”