My Internet Dialog v2.3

By Relurk_ on Oct 31, 2008

Opens any internet site. open by rightclicking and selecting internet or by typeing /internet
You can personolize your favorites menu by editing the list of Sites:

dialog Internet {
on *:dialog:I.fav:init:*:{ didtok $dname 1 44 Google.com,Hawkee.com,Myspace.com,Yahoo.com,OneMoreLevel.com,Relurk.webs.com,AddictingGames.com | did -z $dname 1 } 

Image

dialog Internet {
  title "Internet"
  size -1 -1 79 87
  option dbu
  edit "", 1, 13 24 50 10, autohs
  button "Open", 2, 20 34 37 12
  box "Address", 3, 10 16 57 33
  text "", 4, 6 1 66 14, center
  edit "", 5, 4 64 68 10, read center
  text "", 6, 9 49 59 15, center
  link "Favorites", 8, 26 74 25 8
  menu "File", 7
  item "Exit", 9, 7, ok
}
menu * {
Internet:/Internet
}
alias Internet { dialog $iif($dialog(Internet),-v,-mied) Internet Internet }

on *:dialog:Internet:init:*:{
  did -a $dname 4 You are connecting from $ip
  did -a $dname 5 %o
  did -a $dname 6 Previously Opened: %ot
}
on *:DIALOG:internet:sclick:*:{
  if ($did == 1) { -r $did(5) }
  if ($did == 2) { if (!$did(1).text) { noop $input(No Site was entered ex: hawkee.com,uwo,Error!) } | else { url http:// $+ $did(1).text | set %o http:// $+ $did(1).text | set %ot $asctime(dddd hh:nn tt) | did -ra $dname 6 Previously Opened: $asctime(dddd hh:nn tt) | did -ra $dname 5 $+(http://,$did(1).text) } }
  if ($did == 8) { dialog $iif($dialog(I.Fav),-v,-md) I.Fav I.Fav }
}
dialog I.Fav {
  title "Favorites"
  size -1 -1 74 75
  option dbu
  list 1, 11 9 50 50, size hsbar
  button "Open", 2, 17 61 37 12
}
on *:dialog:I.fav:init:*:{ didtok $dname 1 44 Google.com,Hawkee.com,hawkee.com/snippet/5299/,Myspace.com,OneMoreLevel.com | did -z $dname 1 } 
on *:dialog:I.fav:sclick:*:{
  if ($did == 2) { if (!$did(1).seltext) { noop $input(No Site was selected,uwo,Error!) } | else { url http:// $+ $did(1).seltext | set %ot $asctime(dddd hh:nn tt) | did -ra Internet 6 Previously Opened: $asctime(dddd hh:nn tt) | did -ra Internet 5 $+(http://,$did(1).seltext) } }
}

Comments

Sign in to comment.
RusselB   -  Nov 02, 2008

1st suggestion: Instead of

menu * {
  .Internet:{ dialog $iif($dialog(Internet),-v,-mied) Internet Internet }
}
alias Internet { dialog $iif($dialog(Internet),-v,-mied) Internet Internet }

you could use

menu * {
Internet : Internet
}
alias Internet { dialog $iif($dialog(Internet),-v,-mied) Internet Internet }

2nd suggestion would require putting

/did -b $dname 2

in the init section, and the sclick section that references ID 2. You also will need to add

/did -e $dname 2

to the sclick section that references ID 1

 Respond  
Relurk_   -  Nov 02, 2008

any advice? and RusselB i have no idea what you are talking about sorry!

 Respond  
RusselB   -  Nov 01, 2008

Could save some code by calling the Internet alias from the menu, rather than duplicating the dialog commands.
You could also remove the check to see if dialog ID 1 has a valid entry or not, when dID 2 is clicked, by having 2 disabled until 1 is selected, and disabled again after 2 is selected.

 Respond  
deejay8   -  Oct 31, 2008

lol

 Respond  
napa182   -  Oct 31, 2008

BlueThen said:

Looks to me like the beginning and ending comments of the script are longer than the script itself. Are they necessary?

I never said anything about the script being small, just the ridiculously large amounts of comments at the beginning and end.

um ez fix just dont copy the comments if you dont want to. It's nothing to bitxch about.

and Relurk_ try to be a bit understanding and not tell people to STFU for asking a question

 Respond  
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.