Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Thu Apr 10, 2008 2:43 am   

Large translation errors from mm2k script to zScript. Ideas? - Sorry, its long
 
Alright, I've been messing around with this for a while now and honestly, I don't know zScript that well and find myself researching the correct commands all the time while some of you may just know them off the top of your head. I'll put the mm2k script first, then the zScript that it has been translated into and the errors and problems I'm running into last with line numbers, etc.

The purpose of this script is to calculate hits/misses on youself and mobs, including things like backstabs, etc. and be able to report these.

This is the mm2k script.
Code:

/action {%1 makes a strange sound but is suddenly very silent, as you place %4 in %3 back.} {/math {hits} {$hits+1}} {bsrep2}
/action {%1 slashes at you with %3 and misses.} {/math {ewhiffs} {$ewhiffs+1}} {bsrep2}
/action {%1 turns %3 head, noticing you.} {/math {whiffs} {$whiffs-1};/math {footfalls} {$footfalls+1}} {bsrep2}
/action {A vicious backstab from %3 causes you to choke on your own blood.} {/math {ehits} {$ehits+1}} {bsrep2}
/action {Suddenly %3 stabs you in the back, RIP...} {/math {ehits} {$ehits+1}} {bsrep2}
/action {You hear footfalls behind, turning your head, you notice %3.} {/math {ewhiffs} {$ewhiffs-1};/math {efootfalls} {$efootfalls+1}} {bsrep2}
/action {You lunge at %2 with %4 but miss.} {/math {whiffs} {$whiffs+1}} {bsrep2}
/action {You plunge %2 into the back of %4.} {/math {hits} {$hits+1}} {bsrep2}
/action {You twist %3 as you remove it from} {/math {crits} {$crits + 1}} {bsrep2}
/alias {bsrephelp} {/showme {@Chr(10)@AnsiBold()@ForeRed()Commands  - - - - - - -  What they do... @Chr(10)-------------------------------------------------------@Chr(10)@AnsiBold()@ForeMagenta()Bsrephelp@AnsiBold()@ForeRed()  - - - - - - - @AnsiBold()@ForeGreen()This listing@Chr(10)@AnsiBold()@ForeMagenta()Showmebs@AnsiBold()@ForeRed()  - - - - - - -  @AnsiBold()@ForeGreen()Displays Your BS statistics to your screen@Chr(10)@AnsiBold()@ForeMagenta()Showmebse@AnsiBold()@ForeRed()  - - - - - - - @AnsiBold()@ForeGreen()Displays Enemy BS statistics to your screen@Chr(10)@AnsiBold()@ForeMagenta()Showbs@AnsiBold()@ForeRed()  - - - - - - - -  @AnsiBold()@ForeGreen()Displays Your BS statistics to your chat connections@Chr(10)@AnsiBold()@ForeMagenta()Showbse@AnsiBold()@ForeRed()  - - - - - - - - @AnsiBold()@ForeGreen()Displays Enemy BS statistics to your chat connections@Chr(10)@AnsiBold()@ForeMagenta()Clanbs@AnsiBold()@ForeRed()  - - - - - - - -  @AnsiBold()@ForeGreen()Displays Your BS statistics to your clan channel@Chr(10)@AnsiBold()@ForeMagenta()Clanbse@AnsiBold()@ForeRed()  - - - - - - - - @AnsiBold()@ForeGreen()Displays Enemy BS statistics to your clan channel@Chr(10)@AnsiBold()@ForeMagenta()Rstbs@AnsiBold()@ForeRed()  - - - - - - - - - @AnsiBold()@ForeGreen()Resets counters to 0}} {bsrep2}
/alias {clanbs} {/math {ttlbs} {$hits+$whiffs+$footfalls};/math {hits1} {$hits*100};/math {whiffs1} {$whiffs*100};/math {footfalls1} {$footfalls*100};/math {crits1} {$crits*100};/calldll math.dll {Div} {$hits1 $ttlbs hitsp};/calldll math.dll {Div} {$whiffs1 $ttlbs whiffsp};/calldll math.dll {Div} {$footfalls1 $ttlbs footfallsp};/calldll math.dll {Div} {$crits1 $ttlbs critsp};cl Total: $ttlbs <-*-> Plunges: $hits ($hitsp%) <-*-> Whiffs: $whiffs ($whiffsp%) <-*-> Footfalls: $footfalls ($footfallsp%) <-*-> Criticals: $crits ($critsp%)} {bsrep2}
/alias {clanbse} {/math {ttlbse} {$ehits+$ewhiffs+$efootfalls};/math {ehits1} {$ehits*100};/math {ewhiffs1} {$ewhiffs*100};/math {efootfalls1} {$efootfalls*100};/math {ecrits1} {$ecrits*100};/calldll math.dll {Div} {$ehits1 $ttlbse ehitsp};/calldll math.dll {Div} {$ewhiffs1 $ttlbse ewhiffsp};/calldll math.dll {Div} {$efootfalls1 $ttlbse efootfallsp};/calldll math.dll {Div} {$ecrits1 $ttlbse ecritsp};cl Total: $ttlbse <-*-> Plunges: $ehits ($ehitsp%) <-*-> Whiffs: $ewhiffs ($ewhiffsp%) <-*-> Footfalls: $efootfalls ($efootfallsp%) <-*-> Criticals: $ecrits ($ecritsp%)} {bsrep2}
/alias {rstbs} {/var {hits} {0};/var {whiffs} {0};/var {footfalls} {0};/var {crits} {0};/var {ehits} {0};/var {ewhiffs} {0};/var {efootfalls} {0};/assign bs 1 0;/assign bs 2 0;/assign bs 3 0} {bsrep2}
/alias {showbs} {/math {ttlbs} {$hits+$whiffs+$footfalls};/math {hits1} {$hits*100};/math {whiffs1} {$whiffs*100};/math {footfalls1} {$footfalls*100};/math {crits1} {$crits*100};/calldll math.dll {Div} {$hits1 $ttlbs hitsp};/calldll math.dll {Div} {$whiffs1 $ttlbs whiffsp};/calldll math.dll {Div} {$footfalls1 $ttlbs footfallsp};/calldll math.dll {Div} {$crits1 $ttlbs critsp};/emotea reports: @AnsiBold()@ForeWhite() Total:@AnsiReset()@ForeCyan()@Var(ttlbs)@AnsiBold()@ForeBlue()  Plunges:@AnsiReset()@ForeCyan()$hits @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(hitsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeRed()  Whiffs:@AnsiReset()@ForeCyan()$whiffs @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(whiffsp)%@AnsiReset()@ForeMagenta())@AnsiReset()@ForeYellow()  Footfalls:@AnsiReset()@ForeCyan()$footfalls @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(footfallsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeMagenta()  Criticals:@AnsiReset()@ForeCyan()$crits @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(critsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeBlue()  Sngl:@AnsiReset()@ForeCyan()@GetArray(bs,1)@AnsiBold()@ForeRed()  Dbl:@AnsiReset()@ForeCyan()@GetArray(bs,2)@AnsiBold()@ForeMagenta() Trpl:@AnsiReset()@ForeCyan()@GetArray(bs,3)} {bsrep2}
/alias {showbse} {/math {ettlbs} {$ehits+$ewhiffs+$efootfalls};/math {ehits1} {$ehits*100};/math {ewhiffs1} {$ewhiffs*100};/math {efootfalls1} {$efootfalls*100};/math {ecrits1} {$ecrits*100};/calldll math.dll {Div} {$ehits1 $ettlbs ehitsp};/calldll math.dll {Div} {$ewhiffs1 $ettlbs ewhiffsp};/calldll math.dll {Div} {$efootfalls1 $ettlbs efootfallsp};/calldll math.dll {Div} {$ecrits1 $ettlbs ecritsp};/emotea reports(ENEMY): @AnsiBold()@ForeWhite() Total:@AnsiReset()@ForeCyan()@Var(ettlbs)@AnsiBold()@ForeBlue()  Plunges:@AnsiReset()@ForeCyan()$ehits @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(ehitsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeRed()  Whiffs:@AnsiReset()@ForeCyan()$ewhiffs @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(ewhiffsp)%@AnsiReset()@ForeMagenta())@AnsiReset()@ForeYellow()  Footfalls:@AnsiReset()@ForeCyan()$efootfalls @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(efootfallsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeMagenta()  Criticals:@AnsiReset()@ForeCyan()$ecrits @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(ecritsp)%@AnsiReset()@ForeMagenta())} {bsrep2}
/alias {showbsq} {/math {ttlbs} {$hits+$whiffs+$footfalls};/math {hits1} {$hits*100};/math {whiffs1} {$whiffs*100};/math {footfalls1} {$footfalls*100};/math {crits1} {$crits*100};/calldll math.dll {Div} {$hits1 $ttlbs hitsp};/calldll math.dll {Div} {$whiffs1 $ttlbs whiffsp};/calldll math.dll {Div} {$footfalls1 $ttlbs footfallsp};/calldll math.dll {Div} {$crits1 $ttlbs critsp};/showme {reports: @AnsiBold()@ForeWhite() Total:@AnsiReset()@ForeCyan()@Var(ttlbs)@AnsiBold()@ForeBlue()  Plunges:@AnsiReset()@ForeCyan()$hits @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(hitsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeRed()  Whiffs:@AnsiReset()@ForeCyan()$whiffs @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(whiffsp)%@AnsiReset()@ForeMagenta())@AnsiReset()@ForeYellow()  Footfalls:@AnsiReset()@ForeCyan()$footfalls @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(footfallsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeMagenta()  Criticals:@AnsiReset()@ForeCyan()$crits @AnsiReset()@ForeMagenta()(@AnsiReset()@ForeCyan()@Var(critsp)%@AnsiReset()@ForeMagenta())@AnsiBold()@ForeBlue()  Sngl:@AnsiReset()@ForeCyan()@GetArray(bs,1)@AnsiBold()@ForeRed()  Dbl:@AnsiReset()@ForeCyan()@GetArray(bs,2)@AnsiBold()@ForeMagenta() Trpl:@AnsiReset()@ForeCyan()@GetArray(bs,3)}} {bsrep2}
/alias {showmebs} {/math {ttlbs} {$hits+$whiffs+$footfalls};/math {hits1} {$hits*100};/math {whiffs1} {$whiffs*100};/math {footfalls1} {$footfalls*100};/math {crits1} {$crits*100};/calldll math.dll {Div} {$hits1 $ttlbs hitsp};/calldll math.dll {Div} {$whiffs1 $ttlbs whiffsp};/calldll math.dll {Div} {$footfalls1 $ttlbs footfallsp};/calldll math.dll {Div} {$crits1 $ttlbs critsp};/showme {@AnsiBold()@ForeYellow() @Chr(10)                             Backstab Statistics@AnsiBold()@ForeBlue() @Chr(10)-------------------------------------------------------------------------------@Chr(10) @Chr(10)@AnsiBold()@ForeRed()                      Number of Backstabs Attempted:@AnsiBold()@ForeWhite() @Math($hits+$whiffs+$footfalls) @Chr(10)@AnsiBold()@ForeYellow()                        Number of Backstabs Plunged:@AnsiBold()@ForeWhite() $hits@AnsiBold()@ForeBlue() @Chr(10)                        Number of Backstabs Whiffed:@AnsiBold()@ForeWhite() $whiffs@AnsiBold()@ForeCyan() @Chr(10)                     Number of Backstabs Footfalled:@AnsiBold()@ForeWhite() $footfalls@AnsiBold()@ForeMagenta() @Chr(10)                       Number of Critical Backstabs:@AnsiBold()@ForeWhite() $crits@AnsiBold()@ForeCyan() @Chr(10) @Chr(10)@AnsiBold()@ForeYellow()                    Percentage of Backstabs Plunged:@AnsiBold()@ForeWhite() @Var(hitsp)%@AnsiBold()@ForeBlue() @Chr(10)                    Percentage of Backstabs Whiffed:@AnsiBold()@ForeWhite() @Var(whiffsp)%@AnsiBold()@ForeCyan() @Chr(10)                 Percentage of Backstabs Footfalled:@AnsiBold()@ForeWhite() @Var(footfallsp)% @AnsiBold()@ForeCyan() @Chr(10)@AnsiBold()@ForeMagenta()                   Percentage of Critical Backstabs:@AnsiBold()@ForeWhite() @Var(critsp)%@AnsiBold()@ForeBlue() @Chr(10) @Chr(10)-------------------------------------------------------------------------------@AnsiBold()@ForeRed()}} {bsrep2}
/alias {showmebse} {/math {ettlbs} {$ehits+$ewhiffs+$efootfalls};/math {ehits1} {$ehits*100};/math {ewhiffs1} {$ewhiffs*100};/math {efootfalls1} {$efootfalls*100};/math {ecrits1} {$ecrits*100};/calldll math.dll {Div} {$ehits1 $ettlbs ehitsp};/calldll math.dll {Div} {$ewhiffs1 $ettlbs ewhiffsp};/calldll math.dll {Div} {$efootfalls1 $ettlbs efootfallsp};/calldll math.dll {Div} {$ecrits1 $ettlbs ecritsp};/showme {@AnsiBold()@ForeYellow() @Chr(10)                         Backstab Statistics (ENEMY)@AnsiBold()@ForeBlue() @Chr(10)-------------------------------------------------------------------------------@Chr(10) @Chr(10)@AnsiBold()@ForeRed()                      Number of Backstabs Attempted:@AnsiBold()@ForeWhite() $ettlbs @Chr(10)@AnsiBold()@ForeYellow()                        Number of Backstabs Plunged:@AnsiBold()@ForeWhite() $ehits@AnsiBold()@ForeBlue() @Chr(10)                        Number of Backstabs Whiffed:@AnsiBold()@ForeWhite() $ewhiffs@AnsiBold()@ForeCyan() @Chr(10)                     Number of Backstabs Footfalled:@AnsiBold()@ForeWhite() $efootfalls@AnsiBold()@ForeMagenta() @Chr(10)                       Number of Critical Backstabs:@AnsiBold()@ForeWhite() $ecrits@AnsiBold()@ForeCyan() @Chr(10) @Chr(10)@AnsiBold()@ForeYellow()                    Percentage of Backstabs Plunged:@AnsiBold()@ForeWhite() @Var(ehitsp)%@AnsiBold()@ForeBlue() @Chr(10)                    Percentage of Backstabs Whiffed:@AnsiBold()@ForeWhite() @Var(ewhiffsp)%@AnsiBold()@ForeCyan() @Chr(10)                 Percentage of Backstabs Footfalled:@AnsiBold()@ForeWhite() @Var(efootfallsp)% @AnsiBold()@ForeCyan() @Chr(10)@AnsiBold()@ForeMagenta()                   Percentage of Critical Backstabs:@AnsiBold()@ForeWhite() @Var(ecritsp)%@AnsiBold()@ForeBlue() @Chr(10) @Chr(10)-------------------------------------------------------------------------------@AnsiBold()@ForeRed()}} {bsrep2}
/variable {crits} {40} {bsrep2}
/variable {crits1} {4000} {bsrep2}
/variable {critsp} {3.98} {bsrep2}
/variable {ecrits} {0} {bsrep2}
/variable {ecrits1} {0} {bsrep2}
/variable {ecritsp} {0.00} {bsrep2}
/variable {efootfalls} {3} {bsrep2}
/variable {efootfalls1} {200} {bsrep2}
/variable {efootfallsp} {5.71} {bsrep2}
/variable {ehits} {57} {bsrep2}
/variable {ehits1} {2800} {bsrep2}
/variable {ehitsp} {80.00} {bsrep2}
/variable {ettlbs} {35} {bsrep2}
/variable {ewhiffs} {7} {bsrep2}
/variable {ewhiffs1} {500} {bsrep2}
/variable {ewhiffsp} {14.29} {bsrep2}
/variable {footfalls} {6} {bsrep2}
/variable {footfalls1} {600} {bsrep2}
/variable {footfallsp} {0.60} {bsrep2}
/variable {hits} {959} {bsrep2}
/variable {hits1} {95900} {bsrep2}
/variable {hitsp} {95.42} {bsrep2}
/variable {ttlbs} {1005} {bsrep2}
/variable {whiffs} {40} {bsrep2}
/variable {whiffs1} {4000} {bsrep2}
/variable {whiffsp} {3.98} {bsrep2}
/loadlibrary {Math.dll}
/loadlibrary {math.dll}
/array {bs} {3} {bsrep2}
/assign {bs} {1} {338}
/assign {bs} {2} {332}
/assign {bs} {3} {1}


This is the zScript that its come out to so far.
Code:

#trigger {(*) makes a strange sound but is suddenly very silent, as you place (*) in (*) back.} {#math hits @hits+1} bsrep2
#trigger {(*) slashes at you with (*) and misses.} {#math ewhiffs @ewhiffs+1} bsrep2
#trigger {(*) turns (*) head, noticing you.} {#math whiffs @whiffs-1
#math footfalls @footfalls+1} bsrep2
#trigger {A vicious backstab from (*) causes you to choke on your own blood.} {#math ehits @ehits+1} bsrep2
#trigger {Suddenly (*) stabs you in the back, RIP...} {#math ehits @ehits+1} bsrep2
#trigger {You hear footfalls behind, turning your head, you notice (*).} {#math ewhiffs @ewhiffs-1
#math efootfalls @efootfalls+1} bsrep2
#trigger {You lunge at (*) with (*) but miss.} {#math whiffs @whiffs+1} bsrep2
#trigger {You plunge (*) into the back of (*).} {#math hits @hits+1} bsrep2
#trigger {You twist (*) as you remove it from} {#math crits @crits+1} bsrep2
#alias bsrephelp {#show %char(10)Commands  - - - - - - -  What they do... %char(10)-------------------------------------------------------%char(10)Bsrephelp  - - - - - - - This listing%char(10)Showmebs  - - - - - - -  Displays Your BS statistics to your screen%char(10)Showmebse  - - - - - - - Displays Enemy BS statistics to your screen%char(10)Showbs  - - - - - - - -  Displays Your BS statistics to your chat connections%char(10)Showbse  - - - - - - - - Displays Enemy BS statistics to your chat connections%char(10)Clanbs  - - - - - - - -  Displays Your BS statistics to your clan channel%char(10)Clanbse  - - - - - - - - Displays Enemy BS statistics to your clan channel%char(10)Rstbs  - - - - - - - - - Resets counters to 0} bsrep2
#alias clanbs {#math ttlbs @hits+@whiffs+@footfalls
#math hits1 @hits*100
#math whiffs1 @whiffs*100
#math footfalls1 @footfalls*100
#math crits1 @crits*100
cl Total: @ttlbs <-*-> Plunges: @hits (@hitsp%) <-*-> Whiffs: @whiffs (@whiffsp%) <-*-> Footfalls: @footfalls (@footfallsp%) <-*-> Criticals: @crits (@critsp%)} bsrep2
#alias clanbse {#math ttlbse @ehits+@ewhiffs+@efootfalls
#math ehits1 @ehits*100
#math ewhiffs1 @ewhiffs*100
#math efootfalls1 @efootfalls*100
#math ecrits1 @ecrits*100
cl Total: @ttlbse <-*-> Plunges: @ehits (@ehitsp%) <-*-> Whiffs: @ewhiffs (@ewhiffsp%) <-*-> Footfalls: @efootfalls (@efootfallsp%) <-*-> Criticals: @ecrits (@ecritsp%)} bsrep2
#alias rstbs {#var hits {0}
#var whiffs {0}
#var footfalls {0}
#var crits {0}
#var ehits {0}
#var ewhiffs {0}
#var efootfalls {0}
}
#alias showbs {#math ttlbs @hits+@whiffs+@footfalls
#math hits1 @hits*100
#math whiffs1 @whiffs*100
#math footfalls1 @footfalls*100
#math crits1 @crits*100
#emoteall reports: %FOREWHITE() Total:@{ttlbs}  Plunges:@hits (@{hitsp}%)  Whiffs:@whiffs (@{whiffsp}%)  Footfalls:@footfalls (@{footfallsp}%)  Criticals:@crits (@{critsp}%)  Sngl:%GETARRAY(bs,1)  Dbl:%GETARRAY(bs,2) Trpl:%GETARRAY(bs,3)} bsrep2
#alias showbse {#math ettlbs @ehits+@ewhiffs+@efootfalls
#math ehits1 @ehits*100
#math ewhiffs1 @ewhiffs*100
#math efootfalls1 @efootfalls*100
#math ecrits1 @ecrits*100
#emoteall reports(ENEMY): %FOREWHITE() Total:@{ettlbs}  Plunges:@ehits (@{ehitsp}%)  Whiffs:@ewhiffs (@{ewhiffsp}%)  Footfalls:@efootfalls (@{efootfallsp}%)  Criticals:@ecrits (@{ecritsp}%)} bsrep2
#alias showbsq {#math ttlbs @hits+@whiffs+@footfalls
#math hits1 @hits*100
#math whiffs1 @whiffs*100
#math footfalls1 @footfalls*100
#math crits1 @crits*100
#show reports: %FOREWHITE() Total:@{ttlbs}  Plunges:@hits (@{hitsp}%)  Whiffs:@whiffs (@{whiffsp}%)  Footfalls:@footfalls (@{footfallsp}%)  Criticals:@crits (@{critsp}%)  Sngl:%GETARRAY(bs,1)  Dbl:%GETARRAY(bs,2) Trpl:%GETARRAY(bs,3)} bsrep2
#alias showmebs {#math ttlbs @hits+@whiffs+@footfalls
#math hits1 @hits*100
#math whiffs1 @whiffs*100
#math footfalls1 @footfalls*100
#math crits1 @crits*100
#show  %char(10)                             Backstab Statistics %char(10)-------------------------------------------------------------------------------%char(10) %char(10)                      Number of Backstabs Attempted:%FOREWHITE() %eval(@hits+@whiffs+@footfalls) %char(10)                        Number of Backstabs Plunged:%FOREWHITE() @hits %char(10)                        Number of Backstabs Whiffed:%FOREWHITE() @whiffs %char(10)                     Number of Backstabs Footfalled:%FOREWHITE() @footfalls %char(10)                       Number of Critical Backstabs:%FOREWHITE() @crits %char(10) %char(10)                    Percentage of Backstabs Plunged:%FOREWHITE() @{hitsp}% %char(10)                    Percentage of Backstabs Whiffed:%FOREWHITE() @{whiffsp}% %char(10)                 Percentage of Backstabs Footfalled:%FOREWHITE() @{footfallsp}%  %char(10)                   Percentage of Critical Backstabs:%FOREWHITE() @{critsp}% %char(10) %char(10)-------------------------------------------------------------------------------} bsrep2
#alias showmebse {#math ettlbs @ehits+@ewhiffs+@efootfalls
#math ehits1 @ehits*100
#math ewhiffs1 @ewhiffs*100
#math efootfalls1 @efootfalls*100
#math ecrits1 @ecrits*100
#show  %char(10)                         Backstab Statistics (ENEMY) %char(10)-------------------------------------------------------------------------------%char(10) %char(10)                      Number of Backstabs Attempted:%FOREWHITE() @ettlbs %char(10)                        Number of Backstabs Plunged:%FOREWHITE() @ehits %char(10)                        Number of Backstabs Whiffed:%FOREWHITE() @ewhiffs %char(10)                     Number of Backstabs Footfalled:%FOREWHITE() @efootfalls %char(10)                       Number of Critical Backstabs:%FOREWHITE() @ecrits %char(10) %char(10)                    Percentage of Backstabs Plunged:%FOREWHITE() @{ehitsp}% %char(10)                    Percentage of Backstabs Whiffed:%FOREWHITE() @{ewhiffsp}% %char(10)                 Percentage of Backstabs Footfalled:%FOREWHITE() @{efootfallsp}%  %char(10)                   Percentage of Critical Backstabs:%FOREWHITE() @{ecritsp}% %char(10) %char(10)-------------------------------------------------------------------------------} bsrep2
#var crits {40} "" bsrep2
#var crits1 {4000} "" bsrep2
#var critsp {3.98} "" bsrep2
#var ecrits {0} "" bsrep2
#var ecrits1 {0} "" bsrep2
#var ecritsp {0.0} "" bsrep2
#var efootfalls {3} "" bsrep2
#var efootfalls1 {200} "" bsrep2
#var efootfallsp {5.71} "" bsrep2
#var ehits {57} "" bsrep2
#var ehits1 {2800} "" bsrep2
#var ehitsp {80.0} "" bsrep2
#var ettlbs {35} "" bsrep2
#var ewhiffs {7} "" bsrep2
#var ewhiffs1 {500} "" bsrep2
#var ewhiffsp {14.29} "" bsrep2
#var footfalls {6} "" bsrep2
#var footfalls1 {600} "" bsrep2
#var footfallsp {0.60} "" bsrep2
#var hits {959} "" bsrep2
#var hits1 {95900} "" bsrep2
#var hitsp {95.42} "" bsrep2
#var ttlbs {1005} "" bsrep2
#var whiffs {40} "" bsrep2
#var whiffs1 {4000} "" bsrep2
#var whiffsp {3.98} "" bsrep2


The problems I'm having are as follows:
Quote:

Line 10 unknown command 'calldll'
Line 12 unknown command 'assign'
Line 44 unknown command 'loadibray'


I also have a crap load of other errors but these I think I can sort out.

If anyone feels up to it, just translate the whole thing and post it! I give up!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Apr 10, 2008 10:07 am   
 
Replace these lines
Code:
#math hits1 @hits*100
#math whiffs1 @whiffs*100
#math footfalls1 @footfalls*100
#math crits1 @crits*100
With this
Code:
#math hitssp (@hits*100)/ttlbs
#math whiffssp (@whiffs*100)/ttlbs
#math footfallssp (@footfalls*100)/ttlbs
#math critssp (@crits*100)/ttlbs


For readability change all the lines similar to this
Code:
#show  %char(10)                         Backstab Statistics (ENEMY) %char(10)-------------------------------------------------------------------------------%char(10) %char(10)                      Number of Backstabs Attempted:%FOREWHITE() @ettlbs %char(10)                        Number of Backstabs Plunged:%FOREWHITE() @ehits %char(10)                        Number of Backstabs Whiffed:%FOREWHITE() @ewhiffs %char(10)                     Number of Backstabs Footfalled:%FOREWHITE() @efootfalls %char(10)                       Number of Critical Backstabs:%FOREWHITE() @ecrits %char(10) %char(10)                    Percentage of Backstabs Plunged:%FOREWHITE() @{ehitsp}% %char(10)                    Percentage of Backstabs Whiffed:%FOREWHITE() @{ewhiffsp}% %char(10)                 Percentage of Backstabs Footfalled:%FOREWHITE() @{efootfallsp}%  %char(10)                   Percentage of Critical Backstabs:%FOREWHITE() @{ecritsp}% %char(10) %char(10)-------------------------------------------------------------------------------}
To this
Code:
#SHOW 
#SHOW "                         Backstab Statistics (ENEMY) "
#SHOW "-------------------------------------------------------------------------------"
#SHOW
#SHOW "                      Number of Backstabs Attempted:"%ansi(WHITE) @ettlbs
#SHOW "                        Number of Backstabs Plunged:"%ansi(WHITE) @ehits
#SHOW "                        Number of Backstabs Whiffed:"%ansi(WHITE) @ewhiffs
#SHOW "                     Number of Backstabs Footfalled:"%ansi(WHITE) @efootfalls
#SHOW "                       Number of Critical Backstabs:"%ansi(WHITE) @ecrits
#SHOW
#SHOW "                    Percentage of Backstabs Plunged:"%ansi(WHITE) @{ehitsp}%
#SHOW "                    Percentage of Backstabs Whiffed:"%ansi(WHITE) @{ewhiffsp}%
#SHOW "                 Percentage of Backstabs Footfalled:"%ansi(WHITE) @{efootfallsp}%
#SHOW "                   Percentage of Critical Backstabs:"%ansi(WHITE) @{ecritsp}%
#SHOW
#SHOW "-------------------------------------------------------------------------------"

I didn't quite see any usage of the bs variable in your original script beyond clearing it, and displaying it. The correct group of commands and functions for doing that is #ADDITEM, %replaceitem, %item, etc.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Fri Apr 11, 2008 4:05 am   
 
Wow, thanks. I've worked with this quite a bit and have one more question which I can't seem to work out. The code looks like this:

Code:

 #math ttlbs @hits+@whiffs
 #math @hitssp (@hits*100)/@ttlbs
 #math @whiffssp (@whiffs*100)/@ttlbs
#if (%1 = "") {
  #SHOW "                         Backstab Statistics (Personal) "
  #SHOW "-------------------------------------------------------------------------------"
  #SHOW ""
  #SHOW "                      Number of Backstabs Attempted:"%ansi( WHITE) @ttlbs
  #SHOW "                        Number of Backstabs Plunged:"%ansi( WHITE) @hits
  #SHOW "                        Number of Backstabs Whiffed:"%ansi( WHITE) @whiffs
  #SHOW ""
  #SHOW "                    Percentage of Backstabs Plunged:"%ansi( WHITE) @hitssp%
  #SHOW "                    Percentage of Backstabs Whiffed:"%ansi( WHITE) @whiffssp%
  #SHOW ""
  #SHOW "-------------------------------------------------------------------------------"
  }
#if (%1 != "") {%1 Total Backstab attempts: @ttlbs Hits: @hits"("@hitssp%")" Whiffs: @whiffs "("@whiffssp%")"
}



What I get is this:
Quote:

Backstab Statistics (Personal)
-------------------------------------------------------------------------------

Number of Backstabs Attempted: 8
Number of Backstabs Plunged: 6
Number of Backstabs Whiffed: 2

Percentage of Backstabs Plunged: 66%
Percentage of Backstabs Whiffed: 33%

-------------------------------------------------------------------------------
Total Backstab attempts: 8 Hits: 6(66%) Whiffs: 2 (33%)
Huh?!?

The 2nd "if" is still execuited even if I don't include a veriable for the %1 and it doesn't = anything. If I do put in a veriable, it does put it in front and doesn't execuite the first if and works properly. Otherwise, I got it all worked out. Thanks a lot
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Apr 11, 2008 5:03 am   
 
Try using #IF !%1 instead.

Charneus
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Apr 11, 2008 2:36 pm   
 
Just remove the extra #IF and put the true part in the former #IF's false part.

#if (%1 = "") {#NOOP All your backstab statistics using #show go here} {%1 Total Backstab attempts: @ttlbs Hits: @hits "("@hitssp%")" Whiffs: @whiffs "("@whiffssp%")"}
_________________
Taz :)
Reply with quote
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Fri Apr 11, 2008 9:48 pm   
 
Took me a couple minutes to get the correct syntax but it works now. thanks.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net