• Welcome to Vice City Multiplayer.
 
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

Topics - Ginarrbrik

#1
Support / two questions
September 08, 2010, 12:17:51 PM
Hello,

I have noticed that i cannot rewrite my mirc code to pawn because not all the pawn functions are working, and quite a lot are not available to me.

I have two questions,

when will this be rectified? and when is the next release date for vcmp?

Regards, GKr
#2
Script Showroom / Saving CPU/ Memory usage with loops
August 29, 2008, 03:07:50 PM
Saving CPU/ Memory usage with loops.


  alias iniloop {
    var %a = 0,%b = 0,%c
    while (%a < $ini(test.ini,MYSECTION,0)) {
      %b = $readini(test.ini,MYSECTION,$ini(test.ini,MYSECTION,%a))
      %c = $ini(test.ini,MYSECTION,%a)
      inc %a
      if (%b == MyItem2) echo -a Item: %b - Value: %c
    }
  }


The initialization file: (Called Test.ini)

[MYSECTION]
MyItem1=MyValue1
MyItem2=MyValue2
MyItem3=MyValue3
MyItem4=MyValue4
MyItem5=MyValue5




How to Test your loops:

The best way to check yourself, is to make a loop that will repeat itself about 10000 times,
and in it try all sorts of ways to do what you want, and then see how many ticks it takes for the loop to finish.


alias test {
   var %ticks = $ticks
   var %a = 1
   while (%a < 10000) {

       ;The method you're checking comes here

   }
   echo ?a $calc($ticks - %ticks)
}


Just remember that 1000 ticks are equal to about 1 second.


Note:
Allot of coders are under the impression that the more lines a script holds, the more inefficient it is.

They are presuming incorrect.

The Memory eating and cpu eating elements inside a script are usually down to poorly designed loops.


Try it for yourself.