View Single Post
  #15  
Old 02-16-2013, 07:18 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Quote:
Originally Posted by c0ncrete View Post
in Perl, every time you use the my keyword, you are declaring (creating) the variable that follows within the scope you are in. additionally, every time you use =, you are assigning a value to the left operand.

i don't mean this as an insult, but i would suggest you spend a little time learning some basic programming concepts before continuing further. it will likely be immensely helpful to you to be able to write and run Perl scripts outside of the emulator environment so you can test ideas or debug issues that you may have without having to launch the server or the client whatsoever.

there is some very good material freely available here to get you started:
http://www.perl.org/books/library.html
You were right c0ncrete, I wasn't understanding what it was that you were referring to when you showed me that script.

Since you have showed me that, I have been reading up on Perl and researching various commands to learn a little more in each "area" and in doing so, I was able to learn a few more "tricks of the trade", if you wanna call it that.

Here is what I got:
Code:
foreach my $skill (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
                    16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
                    30, 31, 32, 33, 34, 35, 36, 37, 38, 39,	40, 41, 42,	43,	
                    44, 45, 46, 47,	48, 49, 50,	51, 52, 53,	54, 55, 56,	57, 
                    58, 59, 60, 61,	62, 63, 64,	65, 66, 67,	68, 69, 70,	71,
                    72, 73, 74, 75,	76)

    
 {
    next unless $client->CanHaveSkill($skill);
    my $max = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
    next unless $max > $client->GetRawSkill($skill);
    $client->SetSkill( $skill, $max );
}
You said that if I learned a little more about it, then I could even test the script without launcher a client, and with that, I did a little research and I found that I can use cmd to test the script(s) I compose with the following command:

Code:
perl -wc script.pl
It works in telling me if the syntax is right, and also lists the errors if any are present, but I still trying to find a way to write the results to a text file so I can comb through it as sometimes it scrolls off the screen. Any help on this? (Windows 7 OS)

Thanks for the link(s) to perl, they are extremely helpful.

~Kingmen

P.S. I know you know the command(s) to perl and whatnot, but I am adding this in here in case someone like myself who is new to this can see what I did, and implement it themselves. A lot of the time when I go to search for something, someone will find the answer and not post it. They will only say, "I solved it, thanks!" and not post what they did to solve it.
Reply With Quote