Calculation knights torpia

By baloe12nl on Jun 25, 2012

/*

  • Calculation by means of chat of knight numbers.
  • By filling in time and village number it calculateds he the knight numbers
  • !addtime < attack time of 1k troops > (this is on a village without wall)
    !aantalr < attack time report > < village number which is attacked >
    !aanval hulp (explanation)
    */

This my real first attempt to write someting my self.
It's writen for a internet game calld Torpia, to help the chat users calculat the number of attacking troops.

Please comment so I can learn of my errors

;------------------>>  add time 1k nights

on 5:text:!addtime*:#: {
  unset %1k
  %1k = $duration($$2) 
}

;------------------>>  calculation

on *:text:!aantalr*:#: { 
  if ( $$3 == 1 ) {
    %aantalR = $duration($2)
    %aantalR.1 = $calc( ( %aantalR - 4200) / %1k )
    goto aanT
  }
  if (( $$3 >= 2 ) && ( $$3 <= 21 )) {
    %aantalR = $duration($2)
    %aantalR.1 = $calc( ( %aantalR - 600) / %1k )
    goto aanT
  }
  if ( $$3 >= 22 ) { 
    :error
    /notice $nick agrees your time to your village, fill it in again. 
    /notice $nick you must fill in you village number. 
    /notice $nick 4 1  Stants for your HD and  4 2  to 4 21  for your other villages. | goto ww
  } 
  :aanT
  if ( $ceil( %aantalR.1 ) <= 0 ) goto error
  /msg # $nick becomes attacked on  5 village $$3  with 5+-  $ceil( %aantalR.1 ) $+ k 
  :ww
}

;------------------>>  Help

on *:text:!aanval hulp:#: {
  /notice $nick for the time fill in the time of the attacker such as he stands in your reports. 4 VB: 01:35:02 
  /notice $nick for your villages, fill in the following:  4 1  Stands for your HD and  4 2  to 4 21  for your other villages. 
  /notice $nick to calculate your numbers sees it here as follows. VB: !aantalr <4 time > <4 village number > | goto ww
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.