mIRC Home    About    Download    Register    News    Help

Print Thread
#112604 25/02/05 06:36 PM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
Hm.. what would I do to show how much exp a player currently has [already have] and how much they need until they level?

Code:
on *:text:!exp*:%chan: { 
  if (%acct [ $+ [ $nick ] ] == on) && ($2 == $null) { 
    notice $nick 14Experience: %exp [ $+ [ $nick ] ] 
    notice $nick 14Exp >> Level: %expleft [ $+ [ $nick ] ] 
  } 


That's all I have so far and I know it's wrong frown They need 1500 exp to level up, so this is what I have for leveling:

Code:
if (%lvl [ $+ [ %op ] ] == 1) && (%exp [ $+ [ %op ] ] > 1499) { 
      inc %level [ $+ [ %op ] ] 
      dec %exp [ $+ [ %op ] ] 1500 
      inc %atk [ $+ [ %op ] ] 5 
      inc %def [ $+ [ %op ] ] 3 
      msg $chan 14Congratulations,3 %op $+ 14! You've successfully reached level 2! 
    } 


[lime]


[Coming Soon..]
#112605 26/02/05 12:01 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
If they need 1500 to level up, why can't you deduct their current experience from 1500?
Code:
on *:text:!exp*:%chan: { 
  if (%acct [ $+ [ $nick ] ] == on) && ($2 == $null) {
    var %a = %exp [ $+ [ $nick ] ]
    notice $nick 14Experience:  %a
    notice $nick 14Exp >> Level: $calc(1500-%a) 
  } 
}

#112606 26/02/05 12:17 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
That's what it was! shocked lol, I totally forgot what the $calc command was, Thanks a lot!


[lime]


[Coming Soon..]
#112607 26/02/05 01:37 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
I found the problem with this.. it took some time for me to realize it :tongue: What would I do when they are level 2 and need even more exp for level 3 // etc.. o_o! [Different Exp Requirements for each level]


[lime]


[Coming Soon..]
#112608 26/02/05 02:20 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well, you know their level I assume, lets say it's stored in %lvl<nick>
Now for the exp needed for different levels. I'm using
1500 -> level2; 1800 -> level3; 2100 -> level4; 3000 -> level5 (Obviously you will need to change those values, and add more for any other levels, etc etc smile)
Code:
on *:text:!exp*:%chan: { 
  if (%acct [ $+ [ $nick ] ] == on) &amp;&amp; ($2 == $null) {
    var %a = $($+(%,exp,$nick),2)
    [color:green]var %b = $($+(%,lvl,$nick),2)[color:red] + 1[/color][/color]
    ; ^set a var to the users level PLUS 1 (To get the next level)
    var %c = $gettok([color:blue]1500 1800 2100 3000[/color],%b,32)
    ; find the points needed for the next level.  
    notice $nick 14Experience:  %a
    else notice $nick 14Exp &gt;&gt; Level: $calc(%c - %a) 
    ; Now calc the amount needed from current
    }
  } 
}

#112609 26/02/05 04:45 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
Hm..

Code:
on *:text:!exp*:%chan: {  
   if (%acct [ $+ [ $nick ] ] == on) &amp;&amp; ($2 == $null) {    
     var %a = $($+([color:red]%,exp[/color],$nick),[color:red]2[/color])    
     var %b = $($+([color:red]%,lvl[/color],$nick),[color:red]2[/color]) + 1   
     ; ^set a var to the users level PLUS 1 (To get the next level)    
     var %c = $gettok(1500 1800 2100 3000,%b,[color:red]32[/color])    
     ; find the points needed for the next level.      
     notice $nick 14Experience:  %a    
     else notice $nick 14Exp &gt;&gt; Level: $calc(%c - %a)    
     ; Now calc the amount needed from current    
    } 
  }
}


What do those do o_o? The %, exp // %, lvl aren't suppose to be like %exp, $nick? [Not saying they are..] and I have no idea what the 32 does.. or the 2 for that matter shocked The 2 isnt suppose the be $2 o_o;? lol >a little confused<


[lime]


[Coming Soon..]
#112610 26/02/05 05:24 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
$gettok(text,N,C)
Returns the Nth token in text.

C = the delimiter (or seperator if you like)
"1500 1800 2100 3000" <- the delimiter is spaces, which is char 32
"12.34.56.78" <- The delimiter is . which is char 46
"#chan1,#chan2" >- The delim is a comma. or char 44

This alias will tell you most ascii char numbers, (it won't work for spaces)
alias ascii echo -ac info Ascii: $left($$1,1) = $asc($1)
e.g. "/ascii &"

So...
$gettok(1500 1800 2100 3000,1,32) = 1500
$gettok(1500 1800 2100 3000,2,32) = 1800
$gettok(1500 1800 2100 3000,4,32) = 3000
You can also use a range for N, 2-3 for the second to third, 3- for the third onwards etc.
$gettok(1500 1800 2100 3000,2-3,32) = 1800 2100


$($+(%,exp,$nick),2)

$+() concatenates strings, same as $+ does for two 'words'
$+(%,exp,$nick) = %exp<vaule_of_$nick> = % $+ exp $+ $nick


$( ) is a shorter version of $eval( )
$($+(%,exp,$nick),2)
Evaluates the "$+(%,exp,$nick)" twice, once to join it together to "%expBob11" and once to get the variables value.


Edit: LOL Got sidetracked before finishing the post.

Last edited by Iori; 26/02/05 05:26 AM.
#112611 26/02/05 05:39 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
Hm.. I see.. I think I kind of get it o_o So even if I had more exp and levels, it'd still be 32?

I'm starting to think I should post the entire script so I could show you what I'm talking about an explain everything a little better o_o; [Is there anyway someone can help me edit my script and help me get everything a bit more organized?] x_x sorry to ask.. blush it's a huge script and it's starting to get me confused, so I'm not sure you guys rele wanna go through it.. I organized everything as far as what goes where an everything [like character skills // wpns into different sections] so it's not that it's hard to find everything, it's just difficult to edit (for me.. lol) it's just hard for me to edit and add commands to the script cause I'm not that good with scripting yet x_x


[lime]


[Coming Soon..]
#112612 26/02/05 05:46 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Dude I think you confused him with Token Identifiers.

#112613 26/02/05 05:54 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
> "So even if I had more exp and levels, it'd still be 32?"
Yes, no matter how many there are, if they are seperated by spaces then '32' is the C to use. smile


Depending on just how big "huge" is, you could either post it, or upload it someplace and post a link.

#112614 26/02/05 07:42 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
Okay.. I think I'm ready enough to post it.. Its still really kinda disorganized but:

RPG

These are some of the commands and things I wanted to try and add to the script but wasn't quite sure how..

Code:
&gt;&gt; [lime-bot]'s RPG will be based off of Ragnarok
 - Characters
 - Skills
 - Weapons
 - Armor
&gt;&gt; Everything will be Character-Based
&gt;&gt; Character's will have set Weapons // Armor when bought from the [Shop]
&gt;&gt; Both Players will be provided with 5 random skills at the beginning of every PvP
 - Character-Based
&gt;&gt; Every Player will have the choice of Accepting or Declining a PvP
 - [.accept]
 - [.decline]
&gt;&gt; Once a Player reaches a certain level, their Character Class will upgrade


Under 'Battle Information' I wanted to make it so they recieve 5 skills (wpns), but character-based as well as when they refresh their hand [I got the 5 random skills, just not character-based] The 'Character Stats' [!charstats] is what I was talking about before, that's where I wanted to add the new Exp >> Level (experience till level) command, but it interferes with the 'Leveling Information' below that. Under 'Random Hand Information' is where I wanted all the random character-based skills to be, I just haven't editted them so that they're character-based yet, so you can mainly leave those commands alone.. except I've experienced some of the skills giving negative damage sometimes o_O and it's really annoying. You don't have to worry about anything in the 'Shop Information' because I think I kinda know how to set that up, I just have to add a lot more character-based weapons // armor. Under the 'Using Wpns/Armor in Battle' section is where I'm going to have trouble with, cause I want to have it so when they buy a weapon or armor, it'll stay with them for as long as they have it so they can attack whenever they want with it, and I wanted their current weapon [if any] to show up in their [!charstats] under Current Weapon (again, character-based) and last but not least.. the 'Character-Based Skills' section, I think I pretty much have that section down, its just I want the players to be able to use it once per PvP. Oh and in battle when a certain players use certain weapons or skills, how would I be able to make it so it calculates the damage according to the other players defense? (I kind of have it on some [look under !arrow shower or anything below that] but it damages negative sometimes an heals the other player x_x) ..I'm really sorry to post all this an ask for THIS much help, I mean it's not that it's really that big of a script, but it's a lot of annoying commands an complicated things to add, that wind up changing a lot of other commands. It's okay if you don't want to help me out.. [This is just something I've been trying to get going for a long time now, so what I have written about it basically what I dream the script will one day look like] blush

You can contact me at: irc.deltaanime.net // #tests4lime if u wanna help out a bit or talk to me about it..

[lime]

Last edited by lime; 26/02/05 07:44 AM.

[Coming Soon..]
#112615 26/02/05 04:21 PM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
..Having second thoughts about putting my entire script up there lol, kinda wish I could still edit my post. Anyway, There is one more thing that's been bugging me about the !pvp command, and that's when ppl do it to themselves, so they win twice as much.. x_x how would I make it so they cant PvP themselves? [I really need to talk to someone on mirc or aim about this instead of in the forum :tongue:] I couldn't thank you enough in advance for anyone who helps out a bit. ^_^


[lime]


[Coming Soon..]
#112616 26/02/05 09:56 PM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
Where are you guys when I need you the most? XD I'd really like Iori or SladeCraven to help a bit cause they're the only ones I kinda got to know an trust [not that I don't trust anyone else here ^_^()] I really wish I had a teammate to help me with [lime-bot]'s script so I don't have to do all of this crazy scripting by myself x_x (I don't think I've ever scripted so many lines in my life lol, and it's not that it's hard cause it's mainly copy/paste.. but it's time consuming and exhausting o_o, its at a total of like.. 2,000+ lines or something) Anyway, if someone could team with me or help me out with the link above, I'd really appreciate it.. a lot o_o (wish there was a way to bump your threads lol, mine is starting to drop toward the bottom and I don't really wanna start a new one)


[lime]


[Coming Soon..]
#112617 27/02/05 01:00 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Insert the following as 5th line in the !pvp event

if ($nick == $2) { msg $nick 14Sorry, you big fat cheater but I have accounted for self battles.. | halt }


Oh PS: tell me when you finish it, ill come play the game with ya, You well be able to tell its me, ill be the one beating everyone, the guy using the nothing.i.do.is.legit vhost smile mahahaha

#112618 27/02/05 01:39 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
lol, thanks a lot for the anti-self attack command.. I'll let you guys know how its going and whatnot. I have someone from these forums there helping me out with a couple things [thanks a bunch shin] and he's been a big help so far. ([lime-bot] use to be a fun script I through together but I decided to upgrade em an some of the stuff I wanna upgrade I don't really know how to do lol, that's why I've been asking for so much help.. he was fun for a while, but had a few bugs an glitches which I hope'll be fixed in the new [beta]) lol.. my vhost XD i love that thing..

lol.. I like the comment for the anti-self attack, I'll keep it around for a while grin so it should look something like:

Code:
  if (%away [ $+ [ $2 ] ] == on) { msg $nick 14Sorry,3 $2 14is [Away14]: They cannot battle | halt }
  if ($nick == $2) { msg $nick 14Sorry, you big fat cheater but I have accounted for self battles.. | halt }
  if (%battle == on) { msg $nick 14Sorry, there is already a [PvP] in progress.. | halt }

between the %away and %battle?


[lime]

edit: oOo.. someone just informed me with something that brought up a good point.. what if they opened 2 mircs and fought themselves for more exp // money? is there a way I can make it so its like.. anti-same address lol? [would that be easy to do or..? o_o]

Last edited by lime; 27/02/05 01:52 AM.
#112619 27/02/05 06:13 AM
Joined: Feb 2005
Posts: 16
L
lime Offline OP
Pikka bird
OP Offline
Pikka bird
L
Joined: Feb 2005
Posts: 16
Alright, quick question..

Code:
on *:text:.create*:%chan: {
  if (%account [ $+ [ $nick ] ] == on) {
    msg $nick 14Sorry, you already have an account..
    halt
  }
  if (%account [ $+ [ $nick ] ] != on) &amp;&amp; ($3) &amp;&amp; ($2) {
    if ($2 == Swordsman) {
      notice $nick 14Account Created!
      notice $nick 14[Character]: [4Swordsman14]
      notice $nick 14[Special Attack]: Bash
      notice $nick 14[7Information14]
      notice $nick 14 &gt;&gt; To view your stats, simply type [7.mc14]
      notice $nick 14 &gt;&gt; You may only use your Special Attack once during a PvP
      set %account [ $+ [ $nick ] ] on
      set %race [ $+ [ $nick ] ] Swordsman
      set %name [ $+ [ $nick ] ] $3
      set %money [ $+ [ $nick ] ] 100
      set %exp [ $+ [ $nick ] ] 0
      set %attackpower [ $+ [ $nick ] ] 12
      set %defensepower [ $+ [ $nick ] ] 10
      set %level [ $+ [ $nick ] ] 1
      set %health [ $+ [ $nick ] ] $rand(100,115)
    }

That's an example of what it would look like if someone were to create a Swordsman [as you can see :P] but my question is..

Code:
on *:text:.delete *:%chan: {
  if (*@*nothing.i.do.is.legit iswm $address($nick,5)) &amp;&amp; ($2 ison #) {
    if ($2 == $null) { msg $chan 14[lime14].. your're not doing deleting anything. | halt }
    msg $chan 14[4 $+ $2 $+ 14]'s account has been deleted.              
    set %account [ $+ [ $2 ] ] off
  }
}

Would that be the correct cmd to delete their account? [I wanna be able to wipe all the account or any individual accounts but I'm not sure how to do them all so I'm trying the individual ones, is that correct though? lol]


[lime]

Last edited by lime; 27/02/05 06:14 AM.

[Coming Soon..]

Link Copied to Clipboard