• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Krush[LM]

#1
Quote from: Warrior on October 29, 2007, 03:06 PM
Quote from: Krush[LM] on October 29, 2007, 12:37 PM
Quote from: Warrior on October 04, 2007, 10:19 PM
Quote from: iNsaNe on October 04, 2007, 10:08 PM
Yeah, I'm back to C#. I'm much further with it in C# anyways but I just thought I'd try out C++ to learn it a little.

It's like going from a Supermodel to a Hooker. C++ is a nasty language, only the weak use it.

Are you weak?

Most games are coded in C/C++ so I wouldn't call it weak.

Where did I state it was a weak language? I state it's users are weak. Learn to read before attempting to reply please.

Additionally, games being written in C/C++ do not detach from the fact that it's just a horrible language. Both of them.

Well I thought the comment "C++ is a nasty language, only the weak use it." was implying the code and the user of it are weak.

Anyways we shouldn't get off topic, all I was merely stating is that a majority games (pc, console) are made with C/C++. I know for a fact all DS games are coded in that and if they use C++ at all it's "Limited C++" since it can't support a lot of the languages features.
#2
Quote from: betawarz on October 29, 2007, 01:02 PM
Quote from: Krush[LM] on October 29, 2007, 12:37 PMMost games are coded in C/C++ so I wouldn't call it weak.

I'm not sure how much validity that holds now days, though.
Well at my company and at all the companies I talk to they use mostly C but sometimes limited C++.  I know Sony is using C/C++ and Nintendo does it for DS (one of my current titles).
#3
Quote from: Warrior on October 04, 2007, 10:19 PM
Quote from: iNsaNe on October 04, 2007, 10:08 PM
Yeah, I'm back to C#. I'm much further with it in C# anyways but I just thought I'd try out C++ to learn it a little.

It's like going from a Supermodel to a Hooker. C++ is a nasty language, only the weak use it.

Are you weak?

Most games are coded in C/C++ so I wouldn't call it weak.
#5
Battle.net Bot Development / Re: Error in perl
August 30, 2005, 08:02 AM
Anyone else have ideas on this?
#6
C/C++ Programming / C++ Graphics (Camera stuff)
March 31, 2005, 07:43 PM
I have this assignment for my graphics class and I'm having some issues with my NDC matrix, and Projection matrix.

it's a right handed coordinate system

positive x (right)
positive y (into the screen)
positive z (up)

I can give you the whole project so you can see what was actually done, it's just alot of code to actually post all of it.
#7
Battle.net Bot Development / Re: Error in perl
January 18, 2005, 05:00 PM
Quote from: dyslexify on January 18, 2005, 08:13 AM

if ($byte == "\n")

that might work.
I haven't done any real perl work in quite a while, so my perl skills are rather rusty.

mb was right that didn't fix the problem

I think somehow the connection is becoming null at some point

Here is the function in IRC.pm getting the error:

# Goes through one iteration of the main event loop. Useful for integrating
# other event-based systems (Tk, etc.) with Net::IRC.
# Takes no args.
sub do_one_loop {
    my $self = shift;
   
    # -- #perl was here! --
    # <ChipDude> Pudge:  Do not become the enemy.
    #   <^Pudge> give in to the dark side, you knob.
   
    my ($ev, $sock, $time, $nexttimer, $timeout);
   
    # Check the queue for scheduled events to run.
   
    $time = time();             # no use calling time() all the time.
    $nexttimer = 0;
    foreach $ev ($self->queue) {
if ($self->{_queue}->{$ev}->[0] <= $time) {
    $self->{_queue}->{$ev}->[1]->
(@{$self->{_queue}->{$ev}}[2..$#{$self->{_queue}->{$ev}}]);
    delete $self->{_queue}->{$ev};
} else {
    $nexttimer = $self->{_queue}->{$ev}->[0]
if ($self->{_queue}->{$ev}->[0] < $nexttimer
    or not $nexttimer);
}
    }
   
    # Block until input arrives, then hand the filehandle over to the
    # user-supplied coderef. Look! It's a freezer full of government cheese!

    if ($nexttimer) {
$timeout = $nexttimer - $time < $self->{_timeout}
? $nexttimer - $time : $self->{_timeout};
    } else {
$timeout = $self->{_timeout};
    }
    foreach $ev (IO::Select->select($self->{_read},
    $self->{_write},
    $self->{_error},
    $timeout)) {
foreach $sock (@{$ev}) {
    my $conn = $self->{_connhash}->{$sock};
   
    # $conn->[0] is a code reference to a handler sub.
    # $conn->[1] is optionally an object which the
    #    handler sub may be a method of.
   
    $conn->[0]->($conn->[1] ? ($conn->[1], $sock) : $sock);
}
    }
}


More specific this loop:

foreach $sock (@{$ev}) {
    my $conn = $self->{_connhash}->{$sock};
   
    # $conn->[0] is a code reference to a handler sub.
    # $conn->[1] is optionally an object which the
    #    handler sub may be a method of.
   
    $conn->[0]->($conn->[1] ? ($conn->[1], $sock) : $sock);
}


at this line:

    # $conn->[0] is a code reference to a handler sub.
    # $conn->[1] is optionally an object which the
    #    handler sub may be a method of.
   
    $conn->[0]->($conn->[1] ? ($conn->[1], $sock) : $sock);


they mention $conn->
  • being "code reference to a handler sub

    and the error is :

    Can't use string ("") as a subroutine ref while "strict refs" in use at C:/Perl/site/lib/Net/IRC.pm line 150.


    that's why i'm saying that connection is becoming null but what would cause this?
#8
Battle.net Bot Development / Re: Error in perl
January 18, 2005, 04:30 PM
Quote from: MyndFyre on January 18, 2005, 12:50 AM
I THINK I KNOW WHAT IT IS!!! hehe

Now I could be wrong because I don't use Perl, but I noticed this earlier and thought "I wonder if he knows Windows uses two characters to indicate EOL" but ignored it.


if($byte eq chr(10)) # when the last byte read was a newline character we have enough in $stuff to do something with
{
# Ok so we have a line, we examine it to see what it say:
# All lines start with the name of the profile used when loading JavaOp (in this case `warcraft'), then a colon and space
# so here `warcraft: '.
# I suggest you log into bnet using warcraft, and use the unix program `nc' to
# connect to the socket on JavaOp, then type some stuff on Bnet and see what the output from JavaOp looks like.
# I found that the easiest way.

$stuff = substr($stuff, 0, length($stuff) - 2);

(the last line is #150).

Anyway, it only checks to see if the last character is 10.  But Windows doesn't just use the LF character to indicate the end of the line, as Linux does, but rather indicates the end of a line with a CRLF, carraige return-line feed.

If the line is only one character long -- CR but not LF -- the code
length($stuff) - 2
will return -1, and so somewhere somehow, you're getting an error.

I don't really know how you can fix it other than to remove BOTH the CR and the LF from the string before you attempt to parse it. :)

murphybob reply:

[04:25] <murphybob> you could replace "$stuff = substr($stuff, 0, length($stuff) - 2);" with "chomp($stuff);" chomp is a perl function that removes any CRs or LFs from the end of a string
[04:26] <murphybob> (it actually affects the variable passed to it, so no need for $stuff=chomp($stuff); just chomp($stuff);
[04:26] <murphybob> )
[04:34] <murphybob> but i don't think thats the problem btw.
[04:34] <murphybob> not that i know what /is/ the problem of course :(
#9
General Programming / Re: IRC Bot / Script
January 18, 2005, 05:59 AM
So what do i need to connect to the server?

btw: the bot is up and running on irc.us.gamesurge.net in #kiljaeden #kil'jaeden for now and it just parses the webpage blizzard has, but i'd like to have another form of checking
#10
Battle.net Bot Development / Re: Error in perl
January 18, 2005, 05:57 AM
i threw that eol thing at murphybob and am awaiting his thoughts, but if you guys have any idea what i can do to fix feel free to tell me i'll test it out.
#11
Battle.net Bot Development / Re: Error in perl
January 18, 2005, 05:52 AM
Quote from: dyslexify on January 18, 2005, 12:42 AM
what version of IRC.pm do you have?

from ppm:

Net-IRC 0.75: up to date;

but in the actual file a part commented out says 1.3
#12
Battle.net Bot Development / Re: Error in perl
January 17, 2005, 11:36 PM
Quote from: warz on January 17, 2005, 11:20 PM

$conn->[0]->($conn->[1] ? ($conn->[1], $sock) : $sock;


Try closing the parenthesis.


$conn->[0]->($conn->[1] ? ($conn->[1]), $sock) : $sock;


or removing the parenthesis.


$conn->[0]->($conn->[1] ? $conn->[1], $sock) : $sock;


That might not fix it. I don't know what perl is looking for. It's still a nice thing to do.

Edit: What that's doing is a quick if-then style statement. Returns a sort of 0 and 1 answer. If the first argument is true, the second argument is returned; if the first arg. is false, the second arg. is returned.

it's correct in the code i just forgot to put the 2nd ) in my thing when i posted it
#13
Battle.net Bot Development / Re: Error in perl
January 17, 2005, 09:29 PM
Quote from: Kp on January 17, 2005, 09:12 PM
Check if it runs OK on Linux?  If so, stop worrying and just use it there. :)

I don't have a linux machine to run it on -.-

what now?

this is the line in IRC.pm that the error points to:

$conn->
  • ->($conn->[1] ? ($conn->[1], $sock) : $sock;

    i assume somehow $conn->
  • is becoming null
#14
Battle.net Bot Development / Re: Error in perl
January 17, 2005, 08:41 PM
Quote from: MyndFyre on January 17, 2005, 07:57 PM
My first reaction was: why don't you ask murphybob first?

The second: just turn off "use strict" -- is that possible?  You might be able to find out what the interpreter thinks is a function, then.

I asked him, and he don't know, nor does he particularly want to try and find out, i think he wrote this all for linux.

turning off "use strict" just generates another error at the same line:

Undefined subroutine $main:: called at C:/Perl/site/lib/Net/IRC.pm line 150.
#15
C/C++ Programming / Re: Makefile
January 17, 2005, 07:48 PM
Quote from: Kp on January 15, 2005, 05:08 PM
Quote from: Krush[LM] on January 15, 2005, 04:10 PMWell at school I can do make from the command line but I think i didn't install something at home cause make is unknown

I'm going to assume that you're using Windows at home, since you mentioned ".net".  If so, you need to install make -- Windows doesn't come with one natively (primarily because make is useful).  Check out http://www.mingw.org/ for a Win32 port of GNU make.

i installed that but i can't find where i have to do something to get make to work