All pastes #1374890 Raw Edit

Someone

public text v1 · immutable
#1374890 ·published 2009-03-28 15:34 UTC
rendered paste body
###Clan dialog by Dani l11
###############################
#######ALWAYS ASCENSION########
###############################
#http://www.ascension.poisonedserver.com/Forum/index.php






dialog Clan {
  title "Clan"
  size -1 -1 233 208
  option dbu
  tab "Clan list", 5, 5 2 220 204
  button "Import RuneHead list", 2, 20 190 57 12, tab 5
  list 1, 16 31 196 155, tab 5 size
  button "Info", 9, 166 190 37 12, tab 5
  tab "Clan informatie", 4
  edit "", 6, 13 27 50 10, tab 4 autohs
  text "Clan naam", 7, 15 17 35 8, tab 4
  button "Look up!", 8, 71 26 37 12, tab 4
  text "Default clan", 10, 15 41 43 8, tab 4
  edit "", 11, 13 52 49 10, tab 4 autohs
  button "Set", 12, 71 51 37 12, tab 4
  box "Clan Stats", 13, 110 21 110 136, hide tab 4
  text "Site:", 14, 115 30 25 8, hide tab 4
  text "Runehead:", 15, 115 39 27 8, hide tab 4
  text "Timebase:", 16, 115 48 25 8, hide tab 4
  text "Afkorting:", 17, 115 57 25 8, hide tab 4
  text "Members:", 18, 115 66 25 8, hide tab 4
  text "P2P Combat:", 19, 115 75 31 8, hide tab 4
  text "F2P Combat:", 20, 115 84 33 8, hide tab 4
  text "Attack:", 21, 115 93 25 8, hide tab 4
  text "Strength:", 22, 115 102 25 8, hide tab 4
  text "Defence:", 23, 115 111 25 8, hide tab 4
  text "Hitpoints:", 24, 115 120 25 8, hide tab 4
  text "Prayer:", 25, 115 129 25 8, hide tab 4
  text "Ranged:", 26, 115 138 25 8, hide tab 4
  text "Magic:", 27, 115 147 25 8, hide tab 4
  link "Site", 28, 151 30 66 8, tab 4,  hide tab 4
  link "Site", 29, 151 39 66 8, tab 4,  hide tab 4
  text "Text Label", 30, 151 48 25 8,  hide tab 4
  text "Text Label", 31, 151 57 25 8,  hide tab 4
  text "Text Label", 32, 151 66 25 8,  hide tab 4
  text "Text Label", 33, 151 75 25 8,  hide tab 4
  text "Text Label", 34, 151 84 25 8,  hide tab 4
  text "Text Label", 35, 151 93 25 8,  hide tab 4
  text "Text Label", 36, 151 102 25 8, hide  tab 4
  text "Text Label", 37, 151 111 25 8,  hide tab 4
  text "Text Label", 38, 151 120 25 8, hide  tab 4
  text "Text Label", 39, 151 129 25 8, hide  tab 4
  text "Text Label", 40, 151 138 25 8, hide  tab 4
  text "Text Label", 41, 151 147 25 8, hide  tab 4
  text "Nederlandse Oorlogs Lijst", 42, 18 80 87 15, tab 4
  list 43, 14 90 78 67, tab 4 size
  button "Import", 44, 22 162 60 12, tab 4
  list 45, 0 0 0 0, hide
  list 46, 0 0 0 0, hide
  list 47, 0 0 0 0, hide
  check "Exact match", 48, 71 18 41 8, tab 4
  check "Exact match", 49, 80 191 50 10, tab 5  
  text "", 50, 41 18 148 8, tab 5 center
}
on *:dialog:clan:sclick:9:{
  did -b clan 9
  if (!$did(1).seltext) { noop $input(Geen naam selected,Error,Error) | did -e clan 9 | halt }
  set %userlook $gettok($did(1).seltext,3,32)
  sockopen info runehead.com 80
}
on *:sockopen:info:{
  Sockwrite -nt $sockname GET /clans/personal.php?name= $+ $gettok($did(clan,1).seltext,3,32) $+ &clan= $+ %clan2 HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf
  if (!$dialog(statsmaker))  dialog -m statsmaker statsmaker
  unset %nextcount
  unset %count2
}
on *:sockread:info:{
  var %m
  sockread %m
  var %g = $htm(%m)
  if (<p>Member or Clan not Found</p> == %m) { echo -a 4Member/Clan niet gevonden | did -e clan 9 | sockclose $sockname }
  if (%nextcount == 3) {
    unset %nextcount
    did -ra statsmaker $calc(91+ %count2) %g
  }
  if (%nextcount == 2) {
    set %nextcount 3
    did -ra statsmaker $calc(33+ %count2) %g
  }
  if (%nextcount == 1) {
    set %nextcount 2
    did -ra statsmaker $calc(62+ %count2) %g
  }
  if (%nextcount == Go) {
    set %nextcount 1 
    did -ra statsmaker $calc(120+ %count2) %g
  }
  if (<td><a href='ml.php?clan= isin %m) { 
    set %Nextcount go
    inc %count2
  }
  if (*P2P Combat*F2P Combat* iswm %m) { 
    tokenize 45 %g
    echo -a %g
    dialog -t statsmaker $gettok($did(clan,1).seltext,3,32) in %clanname2 || Rank: $remove($2, :: P2P Combat,-)
  }
  if (<!-- FOOTER ROW --> == %m) {
    dialog -v statsmaker
    sockclose $sockname
    did -e clan 9
  }
}
on *:dialog:statsmaker:close:0:{
  sockclose info 
}
on *:dialog:clan:sclick:2:{
  unset %look
  did -b clan 2
  set %look $input(Geef clan op,eo,Geef clan op,$iif(%Mainclan,%mainclan))
  if (!%look) { noop $input(No valid RuneHead list given,Error,Error) |   did -e clan 2
  halt }
  sockopen look2 runehead.com 80
}

on *:sockopen:look2:{
  Sockwrite -nt $sockname GET /feeds/lowtech/searchclan.php?search= $+ %look $+ &type=2 HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf
  did -r clan 47
  did -r clan 46
  Set %lookin on
  unset %Trigger
  unset %Clanname
}
on *:sockread:look2:{
  var %m
  sockread %m
  tokenize 124 %m
  if (@@End isin %m) { 
    if (%Trigger == 1) { set %Clan $did(clan,47,1)
      set %clanname $did(clan,46,1)
    sockopen look runehead.com 80  }
    elseif ($did(clan,49).state) {
      var %x = 1
      while (%x <= $did(clan,46).lines) { 
        if ($did(clan,46,%x) == $did(clan,6)) { set %Clan $did(clan,47,%x)
          set %clanname $did(clan,46,%x)
          sockopen look runehead.com 80
        }
        inc %x 
      }
      if (!%clanname) { echo -a 4Geen exacte match gevonden | sockclose $sockname | did -e clan 2 | halt }
    }
    else { dialog -m clan2 clan2 }
    sockclose $sockname
  }
  if ($len(%trigger)) { if (!%Trigger) halt
    if (!%m) halt
    $iif(%Trigger == on,set %trigger 1,inc %trigger)
    did -a clan 46 $1
    did -a clan 47 $remove($3,http://www.runehead.com/clans/ml.php?clan=)
  }
  if (@@Start isin %M) { 
  set %Trigger on }
}
on *:sockopen:look:{
  Sockwrite -nt $sockname GET /clans/ml.php?clan= $+ %clan HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf
  unset %count
  did -r clan 1
  unset %ahigh
  unset %Teller
}
on *:sockread:look:{
  var %m
  sockread %m
  tokenize 32 %m
  if (<td><a title= isin %m) { 
    inc %Count
    if (%Count == 5) Unset %count
    if (%Count == 1) { 
      set %aname $htm(%M)
    }
    if (%Count == 2) { Set %ap2p $htm(%m) }
    if (%Count == 4) { Set %atotal $htm(%m) }
    if (!%Count) { Set %ahigh $htm(%m) 
      inc %Teller
      did -a clan 1 %teller $+ . Naam: %aname $chr(124) P2P Combat: %Ap2p $chr(124) Highest skill: %Ahigh
    }
  }
  if (</html> == %m) { 
    set %clan2 %clan
    set %clanname2 %clanname
    did -e clan 2
    dialog -v clan clan
    did -ra clan 50 Clan lijst van %clanname
    sockclose $sockname
  }
}
on *:dialog:clan:sclick:43:{
  did -ra clan 6 $remove($did(43).seltext,$gettok($did(43).seltext,1,32))
}
on *:dialog:clan:sclick:28:{
  run $did(clan,45,1) 
}
on *:dialog:clan:sclick:29:{
  run $did(clan,45,2) 
}
on *:dialog:clan:sclick:12:{
  if (!$did(11)) {
    if (!%mainclan) { noop $input(Geen clan gegeven,Error,Error) | halt }
    var %abc = $?!"Weet je zeker dat je deze instelling wil wijzigen?"
    if (%abc) unset %mainclan
    else   did -ra clan 11 %mainclan

  halt }
  set %mainclan $did(11)
}
on *:dialog:clan:init:0:{
  did -ra clan 6 %Mainclan
  did -ra clan 11 %mainclan
  if (%exact) { did -c clan 48 }
  if (%exact2) { did -c clan 49 } 
}
alias tokenizethis {
  did -r clan 45
  tokenize 32 $1-
  did -a clan 45 $1
  did -a clan 45 $12
  did -ra clan 28 Klik hier
  did -ra clan 29 Klik hier
  did -ra clan 13 Clan stats of %clanname
  did -ra clan 30 $14
  did -ra clan 31 $13
  did -ra clan 32 $2
  did -ra clan 33 $4
  did -ra clan 34 $3
  did -ra clan 35 $8
  did -ra clan 36 $9
  did -ra clan 37 $10
  did -ra clan 38 $5
  did -ra clan 39 $11
  did -ra clan 40 $7
  did -ra clan 41 $6
  var %x = 1
  while (%x <= 29) {
    did -v clan $calc(%x + 12) 
  inc %x }
  did -e clan 8
  did -e clan 6
  dialog -v clan
}
alias clan { dialog -md clan clan }

on *:dialog:clan:sclick:8:{
  if (!$did(6)) {
    noop $input(Geen clan geselecteerd.,Error,Error) 
  halt }
  set %clan $did(6)
  did -b $dname 8
  did -b $dname 6
  sockopen runehead2 runehead.com 80
}

on *:sockopen:runehead2:{
  Sockwrite -nt $sockname GET /feeds/lowtech/searchclan.php?search= $+ %clan $+ &type=2 HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf
  did -r clan 47
  did -r clan 46
  unset %Trigger
  unset %Clanname
}
on *:sockread:runehead2:{
  var %m
  sockread %m
  tokenize 124 %m
  if (@@End isin %m) { 
    if (%Trigger == 1) { set %Clan $did(clan,47,1)
      set %clanname $did(clan,46,1)
    sockopen runehead1 runehead.com 80  }
    elseif ($did(clan,48).state) {
      var %x = 1
      while (%x <= $did(clan,46).lines) { 
        if ($did(clan,46,%x) == $did(clan,6)) { set %Clan $did(clan,47,%x)
          set %clanname $did(clan,46,%x)
          sockopen runehead1 runehead.com 80
        }
        inc %x 
      }
      if (!%clanname) { echo -a 4Geen exacte match gevonden | sockclose $sockname | did -e clan 6 | did -e clan 8 | halt }
    }
    else { dialog -m clan2 clan2 }
    sockclose $sockname
  }
  if ($len(%trigger)) { if (!%Trigger) halt
    if (!%m) halt
    $iif(%Trigger == on,set %trigger 1,inc %trigger)
    did -a clan 46 $1
    did -a clan 47 $remove($3,http://www.runehead.com/clans/ml.php?clan=)
  }
  if (@@Start isin %M) { 
  set %Trigger on }
}
on *:dialog:clan:sclick:44:{ 
  sockopen nol www.lunagang.nl 80
  did -b clan 44
}
on *:sockopen:nol:{
  Sockwrite -nt $sockname GET /tipforum/viewtopic.php?f=25&t=60835 HTTP/1.1
  sockwrite -nt $sockname Host: www.lunagang.nl
  sockwrite -nt $sockname $crlf
  did -r clan 43
}
on *:sockread:nol:{
  var %m
  sockread %m
  if (oorlog verloren isin %m) { 
    var %x = 1
    while ($left($gettok($remove($htm(%m),$gettok($htm(%m),1,61),$gettok($htm(%m),2,61),$gettok($htm(%m),3,61),=== oorlog verloren),$calc(%x + 2),46),-1)) {
      did -a clan 43 %x $+ : $left($gettok($remove($htm(%m),$gettok($htm(%m),1,61),$gettok($htm(%m),2,61),$gettok($htm(%m),3,61),=== oorlog verloren),$calc(%x + 1),46),-1)
      inc %x
    }
    sockclose $sockname
    did -e clan 44
  }
}
on *:sockopen:runehead1:{
  Sockwrite -nt $sockname GET /clans/ml.php?clan= $+ %Clan HTTP/1.1
  sockwrite -nt $sockname Host: runehead.com
  sockwrite -nt $sockname $crlf
  did -r clan 47
  did -r clan 46
  unset %Trigger
}
on *:sockread:runehead1:{
  var %m
  sockread %m
  tokenize 32 %m
  if (Memberlist not found isin %m) { sockclose $sockname
    echo -a 4Clan niet gevonden
    did -e clan 8
    did -e clan 6
    halt
  }
  if (Total Members: isin %m) { set %members $remove($3,</li>,$chr(9))  }
  if (Average P2P Combat: isin %m) { set %avgp2p $remove($4,</li>) }
  if (Average F2P Combat: isin %m) { set %avgf2p $remove($4,</li>,$chr(9)) }
  if (Average Hitpoints: isin %m) { set %avghp $remove($3,</li>) }
  if (Average Overall: isin %m) { set %avgtot $remove($3,</li>) }
  if (Clan Initials: isin %m) {  set %clanint $remove($3,</b>,</p>)  }
  if (Time base: isin %m) { set %timebase $remove($3,</b>,</p>) }
  if (Website isin %m) { set %website $remove($3,href=,',) } 
  if ($gettok(%m,7,124)) {
    tokenize 32 $regsubex($abc(%m),/(#.*|[A-Z])/ig,)
    inc %toz
    inc %avgatt $1
    inc %avgstr $3
    inc %avgdef $2
    inc %avgpray $5
    inc %avgsum $8
    inc %avgrang $6
    inc %avgmage $7
  }
  if (%toz == %members) && (%toz) && (%Members) {
    set %avgatt $round($calc(%avgatt / %members),1)
    set %avgstr $round($calc(%avgstr / %members),1)
    set %avgdef $round($calc(%avgdef / %members),1)
    set %avgpray $round($calc(%avgpray / %members),1)
    set %avgmage $round($calc(%avgmage / %members),1)
    set %avgsum $round($calc(%avgsum / %members),1)
    set %avgrang $round($calc(%avgrang / %members),1)
    tokenizethis $replace(%website %members %avgf2p %avgp2p %avghp %avgmage %avgrang %avgatt %avgstr %avgdef %avgpray http://www.runehead.com/clans/ml.php?clan= $+ %clan %clanint %Timebase,Not,Not set)
    unset %avg*
    unset %toz
    unset %noticenick
    sockclose $sockname
    halt
  }
}
on *:dialog:clan:close:0:{
  if ($dialog(clan2)) dialog -x clan2
  if ($dialog(statsmaker)) dialog -x statsmaker
  sockclose runehead1
  sockclose runehead2
  sockclose info
  set %exact $did(clan,48).state
  set %exact2 $did(clan,49).state
}
on *:dialog:clan2:close:0:{
  if (!%clanname) {
    sockclose runehead1
    sockclose runehead2
    did -e clan 8
did -e clan 6 } }
on *:dialog:clan2:init:0:{
  var %x = 1
  while (%x <= $did(clan,46).lines) {
    did -a clan2 1 $did(clan,46,%x)
    inc %x
  }
  did -c clan2 1 1
}
dialog Clan2 {
  title "Selecteer clan"
  size -1 -1 108 80
  option dbu
  combo 1, 7 24 91 50, size drop
  text "Meerdere resultaten gevonden, selelecteer de clan die je wilt.", 2, 15 5 86 18
  button "OK", 3, 32 54 37 12
}

on *:dialog:clan2:sclick:3:{
  set %Clan $did(clan,47,$did(1).sel)
  set %Clanname $did(clan,46,$did(1).sel)
  if (!%lookin) sockopen runehead1 runehead.com 80 
  else sockopen look runehead.com 80
  dialog -x clan2
}

alias htm return $remove($regsubex($regsubex($1-,/(^[^<]+|<.*>|<[^>]+$|&[^#].*;)/gU,),/&#(.*);/gU,$chr(\1)),$chr(9))
alias abc { return $remove($1,$chr(124),<td>,</td>,<a title=',' style='text-decoration:,color:,none;,;',</li>,</a>)
}
dialog statsmaker {
  title "Stats of"
  size -1 -1 202 250
  option dbu
  text "Overall", 1, 6 12 25 8
  text "Attack", 2, 6 20 25 8
  text "Defence", 3, 6 28 25 8
  text "Strength", 4, 6 36 25 8
  text "Hitpoints", 5, 6 44 25 8
  text "Ranged", 6, 6 52 25 8
  text "Prayer", 7, 6 60 25 8
  text "Magic", 8, 6 68 25 8
  text "Cooking", 9, 6 76 25 8
  text "Woodcutting", 10, 6 84 32 8
  text "Fletching", 11, 6 92 25 8
  text "Fishing", 12, 6 100 25 8
  text "Firemaking", 13, 6 108 27 8
  text "Crafting", 14, 6 116 25 8
  text "Smithing", 15, 6 124 25 8
  text "Mining", 16, 6 132 25 8
  text "Herblore", 17, 6 140 25 8
  text "Agility", 18, 6 148 25 8
  text "Thieving", 19, 6 156 25 8
  text "Slayer", 20, 6 164 25 8
  text "Farming", 21, 6 172 25 8
  text "Runecrafting", 22, 6 180 32 8
  text "Hunter", 23, 6 188 25 8
  text "Construction", 24, 6 196 33 8
  text "Summoning", 25, 6 204 32 8
  text "Duel Tourna", 26, 6 212 33 8
  text "Bounty Hunt", 27, 6 220 34 8
  text "Bounty Rogue", 28, 6 228 35 8
  text "Fist of Guthix", 29, 6 236 34 8
  text "Level", 30, 41 4 25 8
  text "Runescape Rank", 31, 70 4 42 8
  text "XP", 32, 115 4 25 8
  text "Clan rank", 33, 153 4 25 8
  text "", 34, 41 12 25 8
  text "", 35, 41 20 25 8
  text "", 36, 41 28 25 8
  text "", 37, 41 36 25 8
  text "", 38, 41 44 25 8
  text "", 39, 41 52 25 8
  text "", 40, 41 60 25 8
  text "", 41, 41 68 25 8
  text "", 42, 41 76 25 8
  text "", 43, 41 84 25 8
  text "", 44, 41 92 25 8
  text "", 45, 41 100 25 8
  text "", 46, 41 108 25 8
  text "", 47, 41 116 25 8
  text "", 48, 41 124 25 8
  text "", 49, 41 132 25 8
  text "", 50, 41 140 25 8
  text "", 51, 41 148 25 8
  text "", 52, 41 156 25 8
  text "", 53, 41 164 25 8
  text "", 54, 41 172 25 8
  text "", 55, 41 180 25 8
  text "", 56, 41 188 25 8
  text "", 57, 41 196 25 8
  text "", 58, 41 204 25 8
  text "", 59, 41 212 25 8
  text "", 60, 41 220 25 8
  text "", 61, 41 228 25 8
  text "", 62, 41 236 25 8

  text "", 63, 71 12 25 8
  text "", 64, 71 20 25 8
  text "", 65, 71 28 25 8
  text "", 66, 71 36 25 8
  text "", 67, 71 44 25 8
  text "", 68, 71 52 25 8
  text "", 69, 71 60 25 8
  text "", 70, 71 68 25 8
  text "", 71, 71 76 25 8
  text "", 72, 71 84 25 8
  text "", 73, 71 92 25 8
  text "", 74, 71 100 25 8
  text "", 75, 71 108 25 8
  text "", 76, 71 116 25 8
  text "", 77, 71 124 25 8
  text "", 78, 71 132 25 8
  text "", 79, 71 140 25 8
  text "", 80, 71 148 25 8
  text "", 81, 71 156 25 8
  text "", 82, 71 164 25 8
  text "", 83, 71 172 25 8
  text "", 84, 71 180 25 8
  text "", 85, 71 188 25 8
  text "", 86, 71 196 25 8
  text "", 87, 71 204 25 8
  text "", 88, 71 212 25 8
  text "", 89, 71 220 25 8
  text "", 90, 71 228 25 8
  text "", 91, 71 236 25 8

  text "", 92, 115 12 32 8
  text "", 93, 115 20 32 8
  text "", 94, 115 28 32 8
  text "", 95, 115 36 32 8
  text "", 96, 115 44 32 8
  text "", 97, 115 52 32 8
  text "", 98, 115 60 32 8
  text "", 99, 115 68 32 8
  text "", 100, 115 76 32 8
  text "", 101, 115 84 32 8
  text "", 102, 115 92 32 8
  text "", 103, 115 100 32 8
  text "", 104, 115 108 32 8
  text "", 105, 115 116 32 8
  text "", 106, 115 124 32 8
  text "", 107, 115 132 32 8
  text "", 108, 115 140 32 8
  text "", 109, 115 148 32 8
  text "", 110, 115 156 32 8
  text "", 111, 115 164 32 8
  text "", 112, 115 172 32 8
  text "", 113, 115 180 32 8
  text "", 114, 115 188 32 8
  text "", 115, 115 196 32 8
  text "", 116, 115 204 32 8
  text "", 117, 115 212 32 8
  text "", 118, 115 220 32 8
  text "", 119, 115 228 32 8
  text "", 120, 115 236 32 8

  text "", 121, 153 12 25 8
  text "", 122, 153 20 25 8
  text "", 123, 153 28 25 8
  text "", 124, 153 36 25 8
  text "", 125, 153 44 25 8
  text "", 126, 153 52 25 8
  text "", 127, 153 60 25 8
  text "", 128, 153 68 25 8
  text "", 129, 153 76 25 8
  text "", 130, 153 84 25 8
  text "", 131, 153 92 25 8
  text "", 132, 153 100 25 8
  text "", 133, 153 108 25 8
  text "", 134, 153 116 25 8
  text "", 135, 153 124 25 8
  text "", 136, 153 132 25 8
  text "", 137, 153 140 25 8
  text "", 138, 153 148 25 8
  text "", 139, 153 156 25 8
  text "", 140, 153 164 25 8
  text "", 141, 153 172 25 8
  text "", 142, 153 180 25 8
  text "", 143, 153 188 25 8
  text "", 144, 153 196 25 8
  text "", 145, 153 204 25 8
  text "", 146, 153 212 25 8
  text "", 147, 153 220 25 8
  text "", 148, 153 228 25 8
  text "", 149, 153 236 25 8
}