ThaiSEOBoard.com

พัฒนาเว็บไซต์ => CMS & Free Script => หัวข้อเริ่มโดย: marcus14 ใน 25 พฤศจิกายน 2013, 21:09:36

ชื่อเรื่อง: ►►► รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้นสำหรับ imacros แรนดอมข้อความ ครับ
โพสต์โดย: marcus14 ใน 25 พฤศจิกายน 2013, 21:09:36
รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้น ของโค้ดนี้ด้วยครับ  :wanwan017:  :wanwan017: :wanwan044: :wanwan044:
ผมอยากให้ไอมาโคร สุ่ม ข้อความที่เตรียมไว้ สำหรับโพสต์นะครับ




' iMacros Random-Numbers Script
' (c) 2008-2010 iOpus Software

Option Explicit
Dim iim1, iret
Dim rn, i, keyword

MsgBox ("This example script submits random information to a website")

' find current folder
Dim myname, mypath
myname = WScript.ScriptFullName
mypath = Left(myname, InstrRev(myname, "\"))

set iim1= CreateObject ("imacros")
iret = iim1.iimOpen

'Run 3 times
for i = 1 to 3

iret = iim1.iimDisplay("Generating number")

'Create random number between 1 and 5
Randomize
rn = cint (rnd()*5 + 1)

iret = iim1.iimDisplay("Number=" + cstr(rn))

select case rn
 case 1:
  keyword = "Sunshine"
 case 2:
  keyword = "Snow"
 case 3:
  keyword = "Rain"
 case 4:
  keyword = "Wind"
 case 5:
  keyword = "clouds"
case else:
  keyword = "This should not happen"
end select

'Set the variables
  iret = iim1.iimSet("mynumber", cstr(rn))
  iret = iim1.iimSet("mytext", keyword)
 
'Run the macro
  iret = iim1.iimPlay(mypath & "Macros\wsh-random.iim")
  If iret < 0 Then
     MsgBox "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1. iimGetErrorText()
  End If

next

iret = iim1.iimDisplay("The script and macro are completed. Click OK to close the IIM browser and this script.")
iret = iim1.iimClose
WScript.Quit(iret)

Macro code for Wsh-Random:


TAB T=1    
TAB CLOSEALLOTHERS  
URL GOTO=http://demo.imacros.net/Automate/AutoDataEntry    
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:fname CONTENT={{mynumber}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:lname CONTENT={{mytext}}
TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ID:demo ATTR=TXT:SUBMIT



http://wiki.imacros.net/Random-Numbers.vbs  :wanwan003: :wanwan003: :wanwan003:
ชื่อเรื่อง: Re: ►►► รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้นสำหรับ imacros แรนดอมข้อความ ครับ
โพสต์โดย: marcus14 ใน 26 พฤศจิกายน 2013, 07:31:15
 :wanwan044: :wanwan044:
ชื่อเรื่อง: Re: ►►► รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้นสำหรับ imacros แรนดอมข้อความ ครับ
โพสต์โดย: marcus14 ใน 26 พฤศจิกายน 2013, 12:17:37
 :wanwan003: :wanwan003: :wanwan003:
ชื่อเรื่อง: Re: ►►► รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้นสำหรับ imacros แรนดอมข้อความ ครับ
โพสต์โดย: RankCollector ใน 26 พฤศจิกายน 2013, 13:32:46
ติดตามครับ สนใจอยู่...ปกติไอมาโคร มันแรนด้อมได้ด้วยเหรอครับ ... ถ้าทำได้ละแจ่มเลยนิ
ชื่อเรื่อง: Re: ►►► รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้นสำหรับ imacros แรนดอมข้อความ ครับ
โพสต์โดย: marcus14 ใน 26 พฤศจิกายน 2013, 20:08:48
 :wanwan003: :wanwan003:
ชื่อเรื่อง: Re: ►►► รบกวนด้วยครับ อธิบายหรือแนะนำเบื้องต้นสำหรับ imacros แรนดอมข้อความ ครับ
โพสต์โดย: marcus14 ใน 27 พฤศจิกายน 2013, 18:01:30
 :wanwan003: :wanwan003: